Application.AddAddress Method
Word Developer Reference |
Adds an entry to the address book. Each entry has values for one or more tag IDs.
Syntax
expression.AddAddress(TagID, Value)
expression Required. A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
TagID | Required | String array | The tag ID values for the new address entry. Each element in the array can contain one of the strings listed in the following table. Only the display name is required; the remaining entries are optional.
Tag IDDescription
PR_DISPLAY_NAMEName displayed in the Address Book dialog box
PR_DISPLAY_NAME_PREFIXTitle (for example, "Ms." or "Dr.")
PR_GIVEN_NAMEFirst name
PR_SURNAMELast name
PR_STREET_ADDRESSStreet address
PR_LOCALITYCity or locality
PR_STATE_OR_PROVINCEState or province
PR_POSTAL_CODEPostal code
PR_COUNTRYCountry/Region
PR_TITLEJob title
PR_COMPANY_NAMECompany name
PR_DEPARTMENT_NAMEDepartment name within the company
PR_OFFICE_LOCATIONOffice location
PR_PRIMARY_TELEPHONE_NUMBERPrimary telephone number
PR_PRIMARY_FAX_NUMBERPrimary fax number
PR_OFFICE_TELEPHONE_NUMBEROffice telephone number
PR_OFFICE2_TELEPHONE_NUMBERSecond office telephone number
PR_HOME_TELEPHONE_NUMBERHome telephone number
PR_CELLULAR_TELEPHONE_NUMBERCellular telephone number
PR_BEEPER_TELEPHONE_NUMBERBeeper telephone number
PR_COMMENTText included on the Notes tab for the address entry
PR_EMAIL_ADDRESSElectronic mail address
PR_ADDRTYPEElectronic mail address type
PR_OTHER_TELEPHONE_NUMBERAlternate telephone number (other than home or office)
PR_BUSINESS_FAX_NUMBERBusiness fax number
PR_HOME_FAX_NUMBERHome fax number
PR_RADIO_TELEPHONE_NUMBERRadio telephone number
PR_INITIALSInitials
PR_LOCATIONLocation, in the format buildingnumber/roomnumber (for example, 7/3007 represents room 3007 in building 7)
PR_CAR_TELEPHONE_NUMBERCar telephone number
|
Tag ID | Description | ||
PR_DISPLAY_NAME | Name displayed in the Address Book dialog box | ||
PR_DISPLAY_NAME_PREFIX | Title (for example, "Ms." or "Dr.") | ||
PR_GIVEN_NAME | First name | ||
PR_SURNAME | Last name | ||
PR_STREET_ADDRESS | Street address | ||
PR_LOCALITY | City or locality | ||
PR_STATE_OR_PROVINCE | State or province | ||
PR_POSTAL_CODE | Postal code | ||
PR_COUNTRY | Country/Region | ||
PR_TITLE | Job title | ||
PR_COMPANY_NAME | Company name | ||
PR_DEPARTMENT_NAME | Department name within the company | ||
PR_OFFICE_LOCATION | Office location | ||
PR_PRIMARY_TELEPHONE_NUMBER | Primary telephone number | ||
PR_PRIMARY_FAX_NUMBER | Primary fax number | ||
PR_OFFICE_TELEPHONE_NUMBER | Office telephone number | ||
PR_OFFICE2_TELEPHONE_NUMBER | Second office telephone number | ||
PR_HOME_TELEPHONE_NUMBER | Home telephone number | ||
PR_CELLULAR_TELEPHONE_NUMBER | Cellular telephone number | ||
PR_BEEPER_TELEPHONE_NUMBER | Beeper telephone number | ||
PR_COMMENT | Text included on the Notes tab for the address entry | ||
PR_EMAIL_ADDRESS | Electronic mail address | ||
PR_ADDRTYPE | Electronic mail address type | ||
PR_OTHER_TELEPHONE_NUMBER | Alternate telephone number (other than home or office) | ||
PR_BUSINESS_FAX_NUMBER | Business fax number | ||
PR_HOME_FAX_NUMBER | Home fax number | ||
PR_RADIO_TELEPHONE_NUMBER | Radio telephone number | ||
PR_INITIALS | Initials | ||
PR_LOCATION | Location, in the format buildingnumber/roomnumber (for example, 7/3007 represents room 3007 in building 7) | ||
PR_CAR_TELEPHONE_NUMBER | Car telephone number | ||
Value | Required | String array | The values for the new address entry. Each element corresponds to an element in the TagID array. For more information, see the example. |
Example
This example adds an entry to the address book.
Visual Basic for Applications |
---|
|
See Also