Hyperlinks.Add Method
Publisher Developer Reference |
Adds a new Hyperlink object to the specified Hyperlinks collection and returns the new Hyperlink object.
Syntax
expression.Add(Text, Address, RelativePage, PageID, TextToDisplay)
expression A variable that represents a Hyperlinks object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Text | Required | TextRange | TextRange object. The text range to be converted into a hyperlink. |
Address | Optional | String | The address of the new hyperlink. If RelativePage is pbHlinkTargetTypeURL (default) or pbHlinkTargetTypeEmail, Address must be specified or an error occurs. |
RelativePage | Optional | PbHlinkTargetType | The type of hyperlink to add. |
PageID | Optional | Long | The page ID of the destination page for the new hyperlink. If RelativePage is pbHlinkTargetTypePageID, PageID must be specified or an error occurs. The page ID corresponds to the PageID property of the destination page. |
TextToDisplay | Optional | String | The display text of the new hyperlink. If specified, TextToDisplay replaces the text range specified by the Text argument. |
Return Value
Hyperlink
Remarks
RelativePage can be one of these PbHlinkTargetType constants. The default is pbHlinkTargetTypeURL.
pbHlinkTargetTypeEmail |
pbHlinkTargetTypeFirstPage |
pbHlinkTargetTypeLastPage |
pbHlinkTargetTypeNextPage |
pbHlinkTargetTypePageID |
pbHlinkTargetTypePreviousPage |
pbHlinkTargetTypeURL |
Example
The following example adds hyperlinks to shape one and shape two on page one of the active publication. The first hyperlink points to an external Web site, and the second link points to the fourth page in the publication. Shape one and shape two must be text boxes and there must be at least four pages in the publication for this example to work.
Visual Basic for Applications |
---|
|
See Also