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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve information from OutLook..

Status
Not open for further replies.

cnguyen

Programmer
Dec 15, 2002
21
0
0
US
I'm looking for away to get these information from Outlook via VFP...
User/Login information - Username, Email address, password
Server Information - Incoming server and outgoing server setting...

Any information would be appreciate.
Thank You;
Cuong.
 
Hi Cuong,

Basically, you need to use Automation. It's too big a subject to give full details here, but the following code should get you started. This retrieves a few fields from the Contacts folder. Similar techniques can be used for getting information from email messages, calendar items, etc.

* Get an object reference to the Contacts folder
oOut = CREATEOBJECT("outlook.application")
oNS = oOut.GetNamespace("MAPI")
oAdBook = oNS.GetDefaultFolder(10)

* How many contacts?
? oAdBook.Items.Count

* Look at info for the first contact
? oAdBook.Items(1).FirstName
? oAdBook.Items(1).LastName
? oAdBook.Items(1).BusinessFaxNumber

* Loop through the contacts
FOR EACH oContact in oAdBook.Items
? oContact.LastName
? oContact.Birthday
ENDFOR

The various properties and methods of the Outlook object model are all documented in a Help file. Another way to explore the object model is to use Intellisense (in VFP 7 and 8) or the object browser in the Visual Basic Editor in Office.

Hope this will get you started. Come back if you have more questions.
Mike Lewis
Edinburgh, Scotland
 
Thanks for your response Mike;
I'm not looking for the information in the contact list.. the information I'm looking for is the Account information user setup in Outlook under Tools - Options - EmailSetup - EmailAccount.

Cuong.


 
Cuong.

I'm looking for away to get these information from Outlook via VFP...
User/Login information - Username, Email address, password
Server Information - Incoming server and outgoing server setting...


These values a stored in the registry. There is been a few samples on how to access the registry in the recent past on this forum. Although you most likely can retreive the account name, the password itself is encrypted.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Cuong

Although partial information is available this way:
Code:
ow=CREATEOBJECT("outlook.application")
ns=ow.GetNamespace("mapi")
?ns.CurrentUser.Name
?ns.CurrentUser.Address
?ns.CurrentUser.AddressEntry.Type
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top