AddAddress

Syntax

AddAddress AddressProperties$()

Remarks

Adds a new address to the default address book. AddAddress is available only if Windows 95 and either Microsoft Exchange or Schedule+ version 2.0 are installed. In Word version 6.0, AddAddress is unavailable and generates an error.

Argument

Explanation

AddressProperties$()

A predefined two-dimensional array that contains the information for the new address you want to add.

The following example demonstrates how the array should be defined:

Dim addrprop$(numprops - 1, 1)

where numprops is the number of properties you want to specify for the address.

The first dimension of each two-dimensional element (for example, addrprop$(0, 0)) specifies a valid property name. The second dimension (for example, addrprop$(0, 1)) specifies the text value for that property.

For a complete list of valid property names available in the Personal Address Book in Microsoft Exchange, see the table of properties later in this topic.

For more information about how to create a two-dimensional array, see Dim.


The following is a list of the most common address book properties used to get or define address information. These property names correspond to the options in the Properties dialog box of the Personal Address Book in Microsoft Exchange. You can also use the hexadecimal identifier for any MAPI property supported by Microsoft Exchange or any other application that supports MAPI address books. For a complete list of the MAPI properties and their hexadecimal identifiers, see your MAPI software development kit documentation.

Property

Explanation

PR_ADDRTYPE

The addressee's electronic mail address type

PR_BEEPER_TELEPHONE_NUMBER

The addressee's beeper telephone number

PR_BUSINESS_FAX_NUMBER

The addressee's business fax number

PR_CAR_TELEPHONE_NUMBER

The addressee's car telephone number

PR_CELLULAR_TELEPHONE_NUMBER

The addressee's cellular telephone number

PR_COMMENT

The text included on the Notes tab for the address entry

PR_COMPANY_NAME

The name of the addressee's company

PR_COUNTRY

The addressee's country

PR_DEPARTMENT_NAME

The name of the addressee's department within the company


Property

Explanation

PR_DISPLAY_NAME

The name displayed in the Address Book dialog box

PR_EMAIL_ADDRESS

The addressee's electronic mail address

PR_GIVEN_NAME

The addressee's given name, or first name

PR_HOME_FAX_NUMBER

The addressee's home fax number

PR_HOME_TELEPHONE_NUMBER

The addressee's home telephone number

PR_INITIALS

The addressee's initials

PR_LOCALITY

The addressee's city or locality

PR_LOCATION

The addressee's location, in the format buildingnumber /roomnumber; for example, "16/3000" represents room 3000 in building 16

PR_OFFICE_LOCATION

The addressee's office location

PR_OFFICE_TELEPHONE_NUMBER

The addressee's office telephone number

PR_OFFICE2_TELEPHONE_NUMBER

The addressee's second office telephone number

PR_OTHER_TELEPHONE_NUMBER

The addressee's alternate telephone number (other than home or office)

PR_POSTAL_CODE

The addressee's postal code

PR_PRIMARY_FAX_NUMBER

The addressee's primary fax number

PR_PRIMARY_TELEPHONE_NUMBER

The addressee's primary telephone number

PR_RADIO_TELEPHONE_NUMBER

The addressee's radio telephone number

PR_STATE_OR_PROVINCE

The addressee's state or province

PR_STREET_ADDRESS

The addressee's street address

PR_SURNAME

The addressee's surname, or last name

PR_TITLE

The addressee's job title


Example

This example creates a two-dimensional array with valid MAPI address book properties and their respective values, and it adds the new address to the default address book.


Dim addressText$(6,1)
addressText$(0,0) = "PR_SURNAME"
addressText$(0,1) = "Smith"
addressText$(1,0) = "PR_GIVEN_NAME"
addressText$(1,1) = "Phil"
addressText$(2,0) = "PR_STREET_ADDRESS"
addressText$(2,1) = "12345 55th Avenue #5432"
addressText$(3,0) = "PR_LOCALITY"
addressText$(3,1) = "New York"
addressText$(4,0) = "PR_STATE_OR_PROVINCE"
addressText$(4,1) = "NY"
addressText$(5,0) = "PR_POSTAL_CODE"
addressText$(5,1) = "10023"
addressText$(6,0) = "PR_DISPLAY_NAME"
addressText$(6,1) = "Phil Smith"
AddAddress addressText$()

See Also

GetAddress$(), InsertAddress, ToolsCreateEnvelope, ToolsCreateLabels