Table of contents
TOC
Collapse the table of content
Expand the table of content

Window.Close Method (Visio)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Closes a window.

Syntax

expression . Close

expression A variable that represents a Window object.

Return Value

Nothing

Remarks

If the indicated window is the only window open for a document and the document contains unsaved changes, an alert appears asking if you want to save the document. You can use the AlertResponse property to prevent the alert from appearing.

If you close a docked stencil window, only that window is closed. However, if you close a drawing window that contains docked stencils, the docked stencil window is also closed.

Example

This example shows how to close all open ShapeSheet windows. It assumes at least one ShapeSheet window is open in Microsoft Visio.


Public Sub Close_Example() 
 Dim intCounter As Integer 
 intCounter = Windows.Count 

 'Close all ShapeSheet windows that are open. 
 While intCounter <> 0 
 If Windows(intCounter).Type = visSheet Then 
 Windows(intCounter).Close 
 intCounter = Windows.Count 
 Else 
 intCounter = intCounter - 1 
 End If 
 Wend 
End Sub
© 2018 Microsoft