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.

Current Contact Folder Items

 Keywords:  Outlook Current Contact Folder Items

Question:

I am trying to access Outlook current contact folder items such as .FullName .BusinessTelephoneNumber from any open contact, the following code gets the first open contact, but how can I get the items off that folder.
olContactItem =2
objOutlook = ObjectOpen("Outlook.Application")
Is = objOutlook.Inspectors
Contact = Is.item(1) 
Contact.Display 

Answer:

Maybe look at the documentation for the method 'ActiveInspector'.
myOlApp = ObjectOpen("Outlook.Application")
myInspector = myOlApp.ActiveInspector
;Check for active inspector
if myinspector!=0 
	myCurrItem = myinspector.CurrentItem
	;Check if contact item
	if myCurrItem.class == 40
		  name = myCurrItem.fullname
		  busphone = myCurrItem.BusinessTelephoneNumber
		  Message(name,busphone)
	else
		Message("Error","Not Contact Item")
	endif

else
	Message("Error","No Active Inspector")
endif
ObjectClose(myInspector)
ObjectClose(myOlApp)
exit

Article ID:   W15614
File Created: 2003:05:13:11:29:14
Last Updated: 2003:05:13:11:29:14