Shape.AddHyperlink Method
Visio Automation Reference |
Adds a Hyperlink object to a Microsoft Office Visio shape.
Version Information
Version Added: Visio 5.0
Syntax
expression.AddHyperlink
expression A variable that represents a Shape object.
Return Value
Hyperlink
Remarks
Using the AddHyperlink method is equivalent to adding a hyperlink to a shape by clicking Hyperlinks on the Insert menu.
If a Hyperlink object already exists for the shape, the method returns a reference to the existing Hyperlink object.
Example
This example shows how to use the AddHyperlink method to add a hyperlink to a shape. It also shows how to trap errors that arise when you try to access nonexistent hyperlinks. It first attempts to access a hyperlink that does not exist, thereby throwing an error. Then it adds the hyperlink, and when it attempts to access the hyperlink a second time, no error is thrown. Before running this example, replace address with a valid Internet or intranet address.
Visual Basic for Applications |
---|
|
See Also