Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Outlook email addresses
I have the following code working - talking to outlook. However, whenever I
try to return the email address of the contact, I get 'object doesn't support this property or method' thanks for any help. Dim OLF As Outlook.MAPIFolder Dim olContactItem As Outlook.ContactItem Dim ToContact As Recipient Set OLF = GetObject("", "Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderContacts) Set itms = OLF.Items For i = 1 To itms.Count Set itm = itms(i) strContactName = itm.LastName & ", " & itm.FirstName & " " & itm.MiddleName strEmail = itm.email Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Outlook email addresses
change
strEmail = itm.email to strEmail = itm.email1address would be my guess, but this is an excel group and an outlook group would probably be more helpful. -- Regards, Tom Ogilvy "GeorgeFD29" wrote in message ... I have the following code working - talking to outlook. However, whenever I try to return the email address of the contact, I get 'object doesn't support this property or method' thanks for any help. Dim OLF As Outlook.MAPIFolder Dim olContactItem As Outlook.ContactItem Dim ToContact As Recipient Set OLF = GetObject("", "Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderContact s) Set itms = OLF.Items For i = 1 To itms.Count Set itm = itms(i) strContactName = itm.LastName & ", " & itm.FirstName & " " & itm.MiddleName strEmail = itm.email Next |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Outlook email addresses
I say your code, and tried to use it, but I'm getting a compile error on the
first line of DIM code for the MAPI folder. What am I doing wrong? "GeorgeFD29" wrote: I have the following code working - talking to outlook. However, whenever I try to return the email address of the contact, I get 'object doesn't support this property or method' thanks for any help. Dim OLF As Outlook.MAPIFolder Dim olContactItem As Outlook.ContactItem Dim ToContact As Recipient Set OLF = GetObject("", "Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderContacts) Set itms = OLF.Items For i = 1 To itms.Count Set itm = itms(i) strContactName = itm.LastName & ", " & itm.FirstName & " " & itm.MiddleName strEmail = itm.email Next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding email addresses from Excel into Outlook | Excel Discussion (Misc queries) | |||
import email addresses into a outlook distribution list | Excel Discussion (Misc queries) | |||
How do I export email addresses from Excel to Outlook? | Excel Discussion (Misc queries) | |||
How do I export email addresses from excel to outlook? | Excel Discussion (Misc queries) | |||
Extracting email addresses from Outlook Contacts | Excel Programming |