Address Property

Applies To

Envelope object, Hyperlink object.

Description

Hyperlink object: Returns the address (for example, a file name or URL) of the specified hyperlink. Read-only String.

Envelope object: Returns the envelope delivery address as a Range object. Read-only.

Note An error occurs if you use this property when there hasn't been an envelope added to the specified document.

See Also

AddressFromLeft property, AddressFromTop property, AddressStyle property, ReturnAddress property, ReturnAddressStyle property, SubAddress property, Text property.

Example

This example adds a hyperlink to the selection in the active document, sets the address, and then displays the address in a message box.

Set aHLink = ActiveDocument.Hyperlinks.Add(Anchor:=Selection.Range, _
    Address:="http://forms")
MsgBox "The hyperlink goes to " & aHLink.Address
If the active document includes hyperlinks, this example inserts a list of the hyperlink destinations at the end of the document.

Set myRange = ActiveDocument.Range(Start:=ActiveDocument.Content.End - 1)
Count = 0
For Each aHyperlink In ActiveDocument.Hyperlinks
    Count = Count + 1
    With myRange
        .InsertAfter "Hyperlink #" & Count & vbTab
        .InsertAfter aHyperlink.Address
        .InsertParagraphAfter
    End With
Next aHyperlink
This example displays the delivery address if an envelope has been added to the document; otherwise, it displays a message.

On Error GoTo errhandler
addr = ActiveDocument.Envelope.Address.Text
MsgBox Prompt:=addr, Title:="Delivery Address"
errhandler:
If Err = 5852 Then MsgBox "Insert an envelope into the document"