Hyperlink.SubAddress property (Word)

Returns or sets a named location in the destination of the specified hyperlink. Read/write String.

Syntax

expression.SubAddress

expression An expression that returns a 'Hyperlink' object.

Remarks

The named location can be a bookmark in a Microsoft Word document, a named cell or cell reference in a Microsoft Excel worksheet, a named object in a Microsoft Access database, or a slide number in a Microsoft PowerPoint presentation.

Example

This example displays the subaddress of the selected hyperlink.

If Selection.Range.Hyperlinks.Count >= 1 Then 
 MsgBox Selection.Range.Hyperlinks(1).SubAddress 
End If

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

Set SCut = ActiveDocument.Hyperlinks.Add( _ 
 Anchor:= Selection.Range, _ 
 Address:="C:\My Documents\Other.doc", SubAddress:= "temp") 
MsgBox "The hyperlink goes to " & SCut.SubAddress

See also

Hyperlink Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.