Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to retrieve email-adresses from outlook 1

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi!
I'm sure this must be possible but don't know how to fix it.
In our company we are using an exchange email-server.
Users (like me) are having outlook for email-handling.

I want to get an table holding all email-adresses of ALL email-adress available in Inbox, SentItems, any 'private'folder within outlook.

Anyone did this ever?
Or do I have to create an new .pst-file in which I copy all information and process that file?

-Bart
 
The following will get the email address from the messages in the Inbox. You just need to change folder as required. I believe that the SenderEmailAddress property may have been added with Outlook 2003.

Code:
LOCAL oOutlook,oNameSpace,oDefaultFolder
CREATE CURSOR myEmailaddresses (email c(50))
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(6) &&Inbox
loItems = oDefaultFolder.items
FOR EACH loItem IN loItems
  INSERT INTO myEmailaddresses (email) VALUES (  loitem.SenderEmailAddress)
ENDFOR
BROWSE normal

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Mike,
That's a cool trick... is there a way to sort of "Reverse" that process. In other words, if someone sends me an e-mail, can I pass it out of outlook into my application, if I have it open and running? Would like to pass email address, Name (I'll parse myself if I need to)... is that possible???
(This is a borderline Outlook question, but I'd have to figure out how to get it into Fox as well so... the thought just occurred to me when reading your post).



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott

The simplest way of doing this is to use the Outlook activex as described in faq184-3808. Otherwise you can use automation to retrieve any (all) pieces of information regarding e-mails, contact, appointments etc. Some of them are described in faq184-3894.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Mike,
Cool. THanks. Didn't think to look at the FAQ's... duh.
Cheers



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Mike,
Works like a charm!
You'r having a link to source where I can figure out other details like e.g. 'displayed name' of sender?
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top