General information
Category:
COM/DCOM and OLE Automation
Title:
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.
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only