Class Panes (Word VBA)

A collection of Pane objects that represent the window panes for a single window. To use a Panes class variable it first needs to be instantiated, for example


Dim pns as Panes
Set pns = ActiveWindow.Panes

For Each

Here is an example of processing the Panes items in a collection.


Dim pan As Pane
For Each pan In Panes
	
Next pan

Add

Returns a Pane object that represents a new pane to a window.

This method will fail if it is applied to a window that has already been split.

Add (SplitVertical)

SplitVertical: A number that represents the percentage of the window, from top to bottom, you want to appear above the split.


ActiveDocument.ActiveWindow.Panes.Add SplitVertical:=30

Count

Returns a Long that represents the number of panes in the collection.


Dim lngCount As Long
lngCount = ActiveWindow.Panes.Count

Item

Returns the specified pane as a Pane object.

Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position of the individual object.


Dim pan As Pane
Set pan = ActiveWindow.Panes(Index:=1)