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

Window.WindowState Property (Visio)

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

Gets or sets the state of a window. Read/write.


expression . WindowState

expression A variable that represents a Window object.

Return Value



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


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
© 2018 Microsoft