Partager via


Windows.Arrange Method

Visio Automation Reference

Arranges the windows in a Windows collection.

Version Information
 Version Added:  Visio 2.0

Syntax

expression.Arrange(nArrangeFlags)

expression   A variable that represents a Windows object.

Parameters

Name Required/Optional Data Type Description
nArrangeFlags Optional Variant A flag that specifies how to arrange the windows; by default, the windows are arranged vertically.

Return Value
Nothing

Remarks

Using the Arrange method is equivalent to clicking Tile on the Window menu. The active window remains active.

Visio considers windows from top to bottom and then from left to right. You can influence which windows will end up topmost when tiling horizontally (or leftmost when tiling vertically) by prearranging windows.

The following constants declared by the Visio type library are valid values for nArrangeFlags. These constants are also declared by the Visio type library in VisWindowArrange .

Constant Value

VisArrangeTileVertical

1

VisArrangeTileHorizontal

2

VisArrangeCascade

3

Example

The following macro shows how to activate and arrange windows.

Visual Basic for Applications
  
Public Sub Arrange_Example() 
Dim vsoDocument As Visio.Document 
Dim vsoWindow As Visio.Window 
Dim vsoWindow2 As Visio.Window 

'Create two new windows by adding documents.
Set vsoDocument = Documents.Add("") 
Set vsoWindow = ActiveWindow 
Set vsoDocument = Documents.Add("") 

'Use the Arrange method to tile the windows
'(currently the last opened window is active). 
Windows.Arrange 

'Use the Activate method to make the other
'window the active window. 
vsoWindow.Activate 

End Sub

See Also