![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
hy
this is a simple code to send mail .... Sub InviaEmail() Dim AppOut As Outlook.Application Set AppOut = New Outlook.Application Set NewMail = AppOut.CreateItem(olMailItem) NewMail.To = NewMail.CC = NewMail.BCC = NewMail.Subject = "blabla" NewMail.Body = " blabla" NewMail.Attachments.Add "C:\myfile.txt" ' NewMail.Send NewMail.Display End Sub ....but i need to get the "NewMail.To" value directly from my contacts folder. ( i've a group list named "clientii" with 100/120 members that sometimes can change and it would be a very boring job to write all the names to hand or to cancel them and rewrite when they change) tanks |
#2
|
|||
|
|||
![]()
Read the ContactItem.Email1Address property from the contact.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Pippo" wrote in message ... hy this is a simple code to send mail .... Sub InviaEmail() Dim AppOut As Outlook.Application Set AppOut = New Outlook.Application Set NewMail = AppOut.CreateItem(olMailItem) NewMail.To = NewMail.CC = NewMail.BCC = NewMail.Subject = "blabla" NewMail.Body = " blabla" NewMail.Attachments.Add "C:\myfile.txt" ' NewMail.Send NewMail.Display End Sub ...but i need to get the "NewMail.To" value directly from my contacts folder. ( i've a group list named "clientii" with 100/120 members that sometimes can change and it would be a very boring job to write all the names to hand or to cancel them and rewrite when they change) tanks |
#3
|
|||
|
|||
![]() "Dmitry Streblechenko" ha scritto nel messaggio ... Read the ContactItem.Email1Address property from the contact. ... hy i've done it http://msdn2.microsoft.com/en-us/library/bb220057.aspx "Returns or sets a String representing the e-mail address of the first e-mail entry for the contact." ....but i don't know how to use it in my code... NewMail.To = NewMail.CC = NewMail.BCC = i would be able to write in "NewMail.To=" directly the distribution list name stored in my contacts folder (NewMail.To="Clienti" or NewMail.to="query" and not ; ; ; ecc ecc" i don't need to change the DL ....manually from outlook adress book interface i can add and remove members from the distribution list as i need tanks |
#4
|
|||
|
|||
![]()
If the DL comes from one of the contacts folders that are used by the
automatic name resolution (such as the default Contacts folder), you can just set the MailItem.To property to the name DL. The DL name will be resolved when you call MailItem.Recipients.ResolveAll or when teh mesage is sent. Otherwise you can either set the To property to a ";" separated list of DL member addresses (loop through the DistListItem.Members collection) or call MailItem.Recipients.Add for each DL member address. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Pippo" wrote in message ... "Dmitry Streblechenko" ha scritto nel messaggio ... Read the ContactItem.Email1Address property from the contact. .. hy i've done it http://msdn2.microsoft.com/en-us/library/bb220057.aspx "Returns or sets a String representing the e-mail address of the first e-mail entry for the contact." ...but i don't know how to use it in my code... NewMail.To = NewMail.CC = NewMail.BCC = i would be able to write in "NewMail.To=" directly the distribution list name stored in my contacts folder (NewMail.To="Clienti" or NewMail.to="query" and not ; ; ; ecc ecc" i don't need to change the DL ...manually from outlook adress book interface i can add and remove members from the distribution list as i need tanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Deleting Contacts Folder in Folder List | cavasta | Outlook - Using Contacts | 4 | January 8th 08 04:47 PM |
Contacts - Cannot display Folder. The folder is full. | Nanna Vikki | Outlook - Using Contacts | 6 | November 26th 07 06:51 AM |
How to Sync Public Folder Contacts with Personal Folder Contact Li | Larz | Outlook - Using Contacts | 0 | May 14th 07 07:22 PM |
Can I link public folder contacts to the My Contacts folder? | phil | Outlook - Using Contacts | 1 | March 30th 07 03:18 AM |
Notes should retain when updating contacts from folder to folder | Jason Chapman | Outlook - Using Contacts | 0 | April 12th 06 04:11 AM |