Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Using Ole to resolve a name in outlook

Keywords:   Outlook address book Address Lists

Question:

I need a WinBatch script, to check if Outlook has a certain person in my address book. Any ideas how to do that, via OLE?

Answer:

Try This.....

myName=askline("Mapi Resolve Name", "Please enter the name to search for", "Joe")
addrbook=askline("Mapi Resolve Name", "Please enter the address book to search", "Contacts")
Application=ObjectOpen("Outlook.Application")
myNameSpace = Application.GetNameSpace("MAPI")
myAddressList = myNameSpace.AddressLists(addrbook)
myEntries = myAddressList.AddressEntries(myName)

myresult=myEntries.Name
myresultaddr=myEntries.Address

Message("Resolving - %myName% to closest match in address book: %addrbook%", strcat(myresult,@CRLF,myresultaddr))

exit



Article ID:   W14481
Filename:   Using OLE to resolve name in Outlook.txt