Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Contacts / November 2004

Tip: Looking for answers? Try searching our database.

Add contact to DistListItem in a Public Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony Vannier - 24 Nov 2004 09:57 GMT
I use Exchange 2000, and this code fill DistList in a local folder but not
in public folder :

Dim oItemList As DistListItem
Dim oItemContact As Outlook.ContactItem
Dim oItemRecipient As Outlook.Recipient
Dim oItemRecipients As Outlook.Recipients

'Contact
Set oItemContact = oOutlook.GetItemFromID(m_strEnrtyId, m_strStoreId)

'DistList
Set oItemList = oFolder.Items.Add(olDistributionListItem)

oItemList.DLName = "Cadeaux"
Set oItemMail = oOutlook.Application.CreateItem(olMailItem)
Set oItemRecipients = oItemMail.Recipients
Set oItemRecipient = oItemRecipients.Add(oItemContact)

oItemList.AddMembers oItemRecipients

oItemList.Save

Can you help me ?

Thanks
Sue Mosher [MVP-Outlook] - 29 Nov 2004 16:32 GMT
It works fine here, although this statement may be problematic:

   Set oItemRecipient = oItemRecipients.Add(oItemContact)

Recipients.Add takes a name or email address as its argument, not a
ContactItem.

How are you instantiating oFolder?

FYI, there is a newsgroup specifically for general Outlook programming
issues "down the hall" at microsoft.public.outlook.program_vba or, via web
interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_vba


Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

>I use Exchange 2000, and this code fill DistList in a local folder but not
>in public folder :
[quoted text clipped - 22 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.