Discussion Locked

Exchange info into Outlook forms

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello fellow techies:
This may be a simple question...but I can't seem to find the answer..at least not one that works. I'm developing an Outlook public folders app and a request form for it. I would like the request form to pull the Display name, dept. name, and managers name from the Exchange 5.5 server when the form opens. I've gotten some code for this but it doesn't seem to be pulling info from the right MAPI session. I'm only getting 11 fields and I know exchange has many more than that. Got any ideas on how to do this...code snipets would be greatly appreciated. I've checked all the sites and nothing seems to be working. This seems like it should be easier than this. Help!

2 replies

by ivan kravchenko

If I understood correctly, you can try to check the address entry:
UserName = Application.GetNameSpace("MAPI").CurrentUser
Set objMAPISession = Application.CreateObject("MAPI.Session")
objMAPISession.Logon "", "", False, False, 0
Set objAddressLists = objMAPISession.AddressLists
Set myAddressList = objAddressLists("People")
Set myAddressEntries = myAddressList.AddressEntries
nameFound = 0
For Each myAddressEntry In myAddressEntries
If myAddressEntry = UserName Then
nameFound = 1
Exit For
End If
Next
If nameFound = 1 Then
Set myAddressFields = myAddressEntry.Fields
For i = 1 to myAddressFields.Count
If myAddressFields(i).ID = ... Then ...
Next
End If

You can dump all fields along with their IDs to find out exactlywhich ID do you need.
CDOLive web site www.cdolive.com could be extremely helpful as well.

by smittyrt

Thanks for the code snippet...it seems that I have the correct field id...but it still isn't pulling the info needed from the Exchange server. The form is operational except for this...which isn't exactly a make or break situation. users can just as easily fill this info in themselves. It would be great if this worked though. Anybody got any other ideas?

This discussion is closed to new replies.