Window.WindowState property (Visio)
Gets or sets the state of a window. Read/write.
Syntax
expression.WindowState
expression A variable that represents a Window object.
Return value
Long
Remarks
The WindowState property value can be a combination of the constants declared in the Visio type library in VisWindowStates.
Note
The nFlags parameter to the Add method for the Windows collection can be composed of the various bits of VisWindowStates.
If you specify conflicting bits, only one bit is used. For example, if you specify both visWSMaximized and visWSMinimized, the window is maximized.
The visWSVisible flag is ignored when setting the state of a window with the WindowState property. It is used in calls to the Add method for the Windows collection. Use the Visible property of the window to show or hide it. The visWSVisible flag is available only when this property is read.
If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this property maps to the following types:
- Microsoft.Office.Interop.Visio.IVWindow.WindowState
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to minimize the active drawing window.
Public Sub WindowState_Example()
Dim vsoWindow As Visio.Window
'Get the active window.
Set vsoWindow = ActiveWindow
'Minimize the active window.
vsoWindow.WindowState = visWSMinimized
End Sub
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.