Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding email addresses from Excel into Outlook Scooter Excel Discussion (Misc queries) 1 December 15th 09 04:47 PM
import email addresses into a outlook distribution list summer Excel Discussion (Misc queries) 3 December 11th 07 08:45 PM
How do I export email addresses from Excel to Outlook? JasonLi Excel Discussion (Misc queries) 2 May 22nd 06 03:51 PM
How do I export email addresses from excel to outlook? Mark Davies Excel Discussion (Misc queries) 1 February 2nd 05 01:21 PM
Extracting email addresses from Outlook Contacts Todd Huttenstine[_2_] Excel Programming 3 January 12th 04 02:58 AM


All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"