MS Exchange Macro

S

SyrU

I have a macro that opens the Address Book on our server and then you put in
the display name you want and it gives you a certain set of pre-determined
info. (This works great).

I want to cut out the Address Book part and have it read from a list
instead. I am a little stuck. Here is the code:
I have a spreadsheet that contains the PR_DISPLAY_NAME. I know how to
create the loop, just need a little assistance with the objRecipients and
LoadFieldsFromAB subroutine.


HomeServer = ""
strProfileInfo = "ct00" & vbLf & "anon"
Set objSession = CreateObject("MAPI.Session")
objSession.logon , , False, False, , True, strProfileInfo

Set objRecipients = objSession.AddressBook(, "Select Account", True, True,
0)
LoadFieldsFromAB objRecipients.Item(1).AddressEntry

----------------------------------------------------------------------------
Sub LoadFieldsFromAB(objAccount)

DisplayName = objAccount.fields(PR_DISPLAY_NAME).Value
DisplayAccount = objAccount.fields(PR_ACCOUNT).Value
HomeServer = objAccount.fields(PR_EMS_AB_HOME_MTA).Value
strSMTPdomain = "frd.com"

MsgBox (DisplayName)
MsgBox (DisplayAccount)
MsgBox (Mid(HomeServer, 47, 11))

Set objSession = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top