Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Outlook & MailLists
I try to create a new distribution list to Outlook from VFP6. I can create the distribution list, but I'm not able to fill it with members - e-mail addresses. Here's my code:
m.oTempMailItem=ThisForm.oOutlook.Createitem(0)
m.oRecipients=m.oTempMailItem.Recipients
m.oDstList=m.destFolder.Items.Add(7) && 7 = Distrib.list
with m.oDstList
.DLName=alltrim(ThisForm.Container1.TextBox_1.Text)
select address
scan
m.oNewRep=m.oRecipients.Add(allt(address.CompanyName))
m.oNewRep.Address=allt(address.EmailAddress)
endscan
.AddMembers(m.oRecipients)
.Save() && this finally saves the distribution list to Outlook
endwith
I can't assign the recipient's name. When I add a new member manually in Outlook, I can see it within the recipient object, but can't change it from FoxPro.
What am I doing wrong?
Thanks in advance for any ideas.
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement