WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Contact Information In Outlook


;--------------------------------------------------------------------------------------------------------------------------
; Define full name string to match
;--------------------------------------------------------------------------------------------------------------------------
srchname = "Deana Dahley"

;Finds and displays last contacted info for a contact
olFolderContacts = 10 
olApp = CreateObject("Outlook.Application")
objNameSpace = olApp.GetNamespace("MAPI")
objContacts = objNameSpace.GetDefaultFolder(olFolderContacts)
objContact = objContacts.Items.Find(StrCat('[FullName] = "',srchname,'"'))
data = ""
If objContact != 0
   title = srchname
   data = StrCat(data, "BusinessTelephoneNumber ", objContact.BusinessTelephoneNumber, @Crlf) 
   data = StrCat(data, "HomeTelephoneNumber ", objContact.HomeTelephoneNumber, @Crlf) 
   data = StrCat(data, "MobileTelephoneNumber ", objContact.MobileTelephoneNumber)
   Message(title, data)
Else
   Message("Notice","Contact not found.")
EndIf
exit


Article ID:   W17127
File Created: 2007:07:03:14:28:24
Last Updated: 2007:07:03:14:28:24