共用方式為


Hyperlink.NewWindow Property (Visio)

Determines whether Microsoft Visio opens a window in a new location when it follows a hyperlink to open a Web page or another Visio document. Read/write.

Version Information

Version Added: Visio 5.0

Syntax

expression .NewWindow

expression A variable that represents a Hyperlink object.

Return Value

Integer

Remarks

Setting the NewWindow property of a Hyperlink object is equivalent to setting the NewWindow cell in the shape's Hyperlink.name row.

When NewWindow is set to False (0) and the hyperlink's target is a Web page or a document that will open in a browser, the browser will be in the same position and of the same size as the Visio window. If NewWindow is True (non-zero), a browser window will appear at another location (unless the Visio document is maximized).

When the hyperlink's target is a Visio document, the value of NewWindow determines whether the linked document will open in a window on top of the existing document window, or in another location.

Example

The following example draws a rectangle shape, adds a Hyperlink object to the shape, sets its Address and NewWindow properties, and then uses the Follow method to navigate the hyperlink. To better observe the effect this property has, before running this macro, size and position the Visio document window so that it is not in the fully maximized position.

 
Public Sub NewWindow_Example() 
 
 Dim vsoHyperlink As Visio.Hyperlink 
 
 Set vsoHyperlink = ActivePage.DrawRectangle(0,0,5,5).AddHyperlink 
 
 vsoHyperlink.Address = "https://www.microsoft.com/" 
 vsoHyperlink.NewWindow = True 
 vsoHyperlink.Follow 
 
End Sub