GetAddress Method

See Also         Example         Applies To

Returns an address from the default address book.

Syntax

expression.GetAddress(Name, AddressProperties, UseAutoText, DisplaySelectDialog, SelectDialog, CheckNamesDialog, RecentAddressesChoice, UpdateRecentAddresses)

expression   Required. An expression that returns an Application object.

Name   Optional Variant. The name of the addressee, as specified in the Search Name dialog box in the address book.

AddressProperties   Optional Variant. If UseAutoText is True, this argument denotes the name of an AutoText entry that defines a sequence of address book properties. If UseAutoText is False or omitted, this argument defines a custom layout. Valid address book property names or sets of property names are surrounded by angle brackets ("<" and ">") and separated by a space or a paragraph mark (for example, "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_OFFICE_TELEPHONE_NUMBER>").

If this argument is omitted, default AutoText entry named "AddressLayout" is used. If "AddressLayout" hasn't been defined, the following address layout definition is used: "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_STREET_ADDRESS>" & vbCr & "<PR_LOCALITY>" & ", " & "<PR_STATE_OR_PROVINCE>" & " " & "<PR_POSTAL_CODE>" & vbCr & "<PR_COUNTRY>".

For a list of the valid address book property names, see the AddAddress method.

UseAutoText   Optional Variant. True if AddressProperties specifies the name of an AutoText entry that defines a sequence of address book properties; False if it specifies a custom layout.

DisplaySelectDialog   Optional Variant. Specifies whether the Select Name dialog box is displayed, as shown in the following table.

Value Result
0 (zero) The Select Name dialog box isn't displayed.
1 or omitted The Select Name dialog box is displayed.
2 The Select Name dialog box isn't displayed, and no search for a specific name is performed. The address returned by this method will be the previously selected address.

SelectDialog   Optional Variant. Specifies how the Select Name dialog box should be displayed (that is, in what mode), as shown in the following table.

Value Display mode
0 (zero) or omitted Browse mode
1 Compose mode, with only the To: box
2 Compose mode, with both the To: and CC: boxes

CheckNamesDialog   Optional Variant. True to display the Check Names dialog box when the value of the Name argument isn't specific enough.

RecentAddressesChoice   Optional Variant. True to use the list of recently used return addresses.

UpdateRecentAddresses   Optional Variant. True to add an address to the list of recently used addresses; False to not add the address. If SelectDialog is set to 1 or 2, this argument is ignored.