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 / Programming VBA / July 2007

Tip: Looking for answers? Try searching our database.

>> Recipients.add

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan - 16 Jul 2007 04:22 GMT
Hi, I want to create a distribution list from contacts listed in MS Access. I
can create the distribution list contact item and fill with recipients so
that their name is actually their email address.

Unfortunitely this is not user friendly to review when compared with having
each recipient listed with their name and email address in separate
columns/fields. The following adds a recipient with the same value in the
name and email address fields. That is, name is someone@somewhere.co.nz and
email is someone@somewhere.co.nz

   Set myOlDistList = myOlApp.CreateItem(olDistributionListItem)
   myOlDistList.DLName = DistListName
   Do Until rstDistList.EOF
       Set myOlRecipient = myOlApp.Session.CreateRecipient(rstDistList!Email)
       myOlRecipient.Resolve
       myOlDistList.AddMember myOlRecipient
       rstDistList.MoveNext
       DoEvents
   Loop
   rstDistList.Close
   myOlDistList.Save
   myOlDistList.Display

I would like to create each recipient with the name of the contact and the
email address stored in the email field.

Any ideas or suggestions appreciated :-)

Many thanks, Jonathan
Dmitry Streblechenko - 16 Jul 2007 07:39 GMT
Call CreateRecipient passing the name in the format "Name
<user@example.com>"

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hi, I want to create a distribution list from contacts listed in MS
> Access. I
[quoted text clipped - 29 lines]
>
> Many thanks, Jonathan
Jonathan - 16 Jul 2007 21:32 GMT
> Call CreateRecipient passing the name in the format "Name
> <user@example.com>"
[quoted text clipped - 3 lines]
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool

Supurb, works like a charm!

Many thanks, Jonathan

> > Hi, I want to create a distribution list from contacts listed in MS
> > Access. I
[quoted text clipped - 29 lines]
> >
> > Many thanks, Jonathan
 
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



©2009 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.