K
Kristof Ternoey
Hi
I'm trying to develop a application in VB that creates distributionlist.
That works well but I'm unable to add recipitients to the distributionlists.
They always stay empty.
I think there is no method that allows you to create a recipitient
(displayname, emailaddress) and add to that specific distributionlist.
That's my code so far:
Dim olapp As Outlook.Application
Dim mfolder As Outlook.MAPIFolder
Dim myNameSpace As Outlook.NameSpace
olapp = New Outlook.ApplicationClass
mfolder =
olapp.GetNamespace("MAPI").GetDefaultFolder(Outlook.OlDefaultFolders.olFolde
rContacts)
Dim mydistlist As Outlook.DistListItem
Dim myRecipient As Outlook.Recipient
Dim myTempItem As Outlook.MailItem
Dim myaddressentry As Outlook.AddressEntry
Dim mycontact As Outlook.ContactItem
mydistlist = olapp.CreateItem(Outlook.OlItemType.olDistributionListItem)
myTempItem = olapp.CreateItem(Outlook.OlItemType.olMailItem)
Dim rec As Outlook.Recipient
myTempItem = olapp.CreateItem(Outlook.OlItemType.olMailItem)
mydistlist.DLName = "dfsqfdsdfsd"
myRecipient = olapp.Session.CreateRecipient("Dan Wilson")
myRecipient.Resolve()
mydistlist.AddMember(myRecipient)
mydistlist.Save()
mydistlist.Display()
Any help would be appreciated, I'm stuck
cheers
Kri
I'm trying to develop a application in VB that creates distributionlist.
That works well but I'm unable to add recipitients to the distributionlists.
They always stay empty.
I think there is no method that allows you to create a recipitient
(displayname, emailaddress) and add to that specific distributionlist.
That's my code so far:
Dim olapp As Outlook.Application
Dim mfolder As Outlook.MAPIFolder
Dim myNameSpace As Outlook.NameSpace
olapp = New Outlook.ApplicationClass
mfolder =
olapp.GetNamespace("MAPI").GetDefaultFolder(Outlook.OlDefaultFolders.olFolde
rContacts)
Dim mydistlist As Outlook.DistListItem
Dim myRecipient As Outlook.Recipient
Dim myTempItem As Outlook.MailItem
Dim myaddressentry As Outlook.AddressEntry
Dim mycontact As Outlook.ContactItem
mydistlist = olapp.CreateItem(Outlook.OlItemType.olDistributionListItem)
myTempItem = olapp.CreateItem(Outlook.OlItemType.olMailItem)
Dim rec As Outlook.Recipient
myTempItem = olapp.CreateItem(Outlook.OlItemType.olMailItem)
mydistlist.DLName = "dfsqfdsdfsd"
myRecipient = olapp.Session.CreateRecipient("Dan Wilson")
myRecipient.Resolve()
mydistlist.AddMember(myRecipient)
mydistlist.Save()
mydistlist.Display()
Any help would be appreciated, I'm stuck
cheers
Kri