Arrange method
Arranges the windows in a Windows collection.
Version added
2.0
Syntax
| |
object |
Required. An expression that returns a Windows collection. |
nArrangeFlags |
Optional Variant. A flag that specifies how to arrange the windows; by default, the windows are arranged vertically. |
Remarks
Using the Arrange method is equivalent to clicking Tile on the Window menu. The active window remains active.
Visio considers windows top to bottom, then 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 uses the SetWindowRect method to prearrange windows. This creates the desired results when the Arrange method is called to tile the windows. In this example, window(i) ends up above window(i+1).
Public Sub p()
For i = 1 To Windows.Count
Windows(i).SetWindowRect i + 100, i + 100, 100, 100
Next i
Windows.Arrange visArrangeTileHorizontal
End Sub