Application.GetAddress Method
Word Developer Reference |
Returns an address from the default address book.
Syntax
expression.GetAddress(Name, AddressProperties, UseAutoText, DisplaySelectDialog, SelectDialog, CheckNamesDialog, RecentAddressesChoice, UpdateRecentAddresses)
expression Required. A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
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 the AddressProperties parameter 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.
ValueResult
0 (zero)The Select Name dialog box isn't displayed.
1 or omittedThe Select Name dialog box is displayed.
2The 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.
|
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.
ValueDisplay mode
0 (zero) or omittedBrowse mode
1Compose mode, with only the To: box
2Compose mode, with both the To: and CC: boxes
|
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. |
Return Value
String
Remarks
Example
This example sets the variable strAddress to John Smith's address, moves the insertion point to the beginning of the document, and inserts the address. The inserted address will include the default address book properties.
Visual Basic for Applications |
---|
|
The following example returns John Smith's address, using the "My Address Layout" AutoText entry as the layout definition. "My Address Layout" is defined in the active template and contains a set of address properties assigned to the text$ variable. The example also adds John Smith's address to the list of recently used addresses.
Visual Basic for Applications |
---|
|
See Also