Share via


_Application.GetAddress Method

Returns an address from the default address book.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function GetAddress ( _
    ByRef Name As Object, _
    ByRef AddressProperties As Object, _
    ByRef UseAutoText As Object, _
    ByRef DisplaySelectDialog As Object, _
    ByRef SelectDialog As Object, _
    ByRef CheckNamesDialog As Object, _
    ByRef RecentAddressesChoice As Object, _
    ByRef UpdateRecentAddresses As Object _
) As String
'Usage
Dim instance As _Application
Dim Name As Object
Dim AddressProperties As Object
Dim UseAutoText As Object
Dim DisplaySelectDialog As Object
Dim SelectDialog As Object
Dim CheckNamesDialog As Object
Dim RecentAddressesChoice As Object
Dim UpdateRecentAddresses As Object
Dim returnValue As String

returnValue = instance.GetAddress(Name, _
    AddressProperties, UseAutoText, _
    DisplaySelectDialog, SelectDialog, _
    CheckNamesDialog, RecentAddressesChoice, _
    UpdateRecentAddresses)
string GetAddress(
    ref Object Name,
    ref Object AddressProperties,
    ref Object UseAutoText,
    ref Object DisplaySelectDialog,
    ref Object SelectDialog,
    ref Object CheckNamesDialog,
    ref Object RecentAddressesChoice,
    ref Object UpdateRecentAddresses
)

Parameters

  • Name
    Type: System.Object%
    Optional Object. The name of the addressee, as specified in the Search Name dialog box in the address book.
  • AddressProperties
    Type: System.Object%
    Optional Object. 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, a 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
    Type: System.Object%
    Optional Object. 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
    Type: System.Object%
    Optional Object. 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
    Type: System.Object%
    Optional Object. 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
    Type: System.Object%
    Optional Object. True to display the Check Names dialog box when the value of the Name argument isn't specific enough.
  • RecentAddressesChoice
    Type: System.Object%
    Optional Object. True to use the list of recently used return addresses.
  • UpdateRecentAddresses
    Type: System.Object%
    Optional Object. 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

Type: System.String

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Word Namespace