ContactItem Object

Microsoft Outlook Visual Basic

ContactItem Object

ContactItem Multiple objects

Represents a contact in a contacts folder. A contact can represent any person with whom you have any personal or professional contact.

Using the ContactItem Object

Use the CreateItem method to create a ContactItem object that represents a new contact.

The following Visual Basic for Applications (VBA) example returns a new contact.

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olContactItem)

		

The following Microsoft Visual Basic Scripting Edition (VBScript) example returns a new contact.

Set myItem = Application.CreateItem(olContactItem)

		

Use Items (index), where index is the index number of a contact or a value used to match the default property of a contact, to return a single ContactItem object from a Contacts folder.

Remarks

If a program tries to reference any type of recipient information by using the Outlook object model, a dialog box is displayed that asks you to confirm access to this information. You can allow access to the Address Book or recipient information for up to ten minutes after you receive the dialog box. This allows features, such as mobile device synchronization, to be completed.

You receive the confirmation dialog box when a solution tries to programmatically access the following properties of the ContactItem object:

  • Email1Address
  • Email1AddressType
  • Email1DisplayName
  • Email1EntryID
  • Email2Address
  • Email2AddressType
  • Email2DisplayName
  • Email2EntryID
  • Email3Address
  • Email3AddressType
  • Email3DisplayName
  • Email3EntryID
  • NetMeetingAlias
  • ReferredBy