Class Pane (Word VBA)

The class Pane represents a window pane. The Pane object is a member of the Panes collection. The Panes collection includes all the window panes for a single window.

The main procedures of class Pane are Activate, Close and Panes.Add

Set

To use a Pane class variable it first needs to be instantiated, for example

Dim pan as Pane
Set pan = ActiveWindow.ActivePane

The following procedures can be used to set variables of type Pane: Next, Previous, Panes.Add, Panes.Item, Window.ActivePane and Window.Panes

For Each

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

For Each pan In Windows(1).Panes 
 pan.View.ShowAll = True 
Next pan

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Display/Show with its procedures DisplayRulers and DisplayVerticalRuler
Page with its procedures Pages and PageScroll

Methods

These are the main methods of the Pane class

Activate - Activates the specified pane.

ActiveWindow.ActivePane.Activate

Close - Closes the specified Mail Merge data source, pane, or task.

ActiveWindow.ActivePane.Close

Panes.Add - Returns a Pane object that represents a new pane to a window.

Dim pan As Pane
Set pan = ActiveWindow.Panes.Add()

Other Methods

LargeScroll - Scrolls a window or pane by the specified number of screens.

ActiveWindow.ActivePane.LargeScroll

SmallScroll - Scrolls a window by the specified number of lines.

ActiveWindow.ActivePane.SmallScroll

Properties

BrowseWidth returns the width (in points) of the area in which text wraps in the specified pane.

Dim lngBrowseWidth As Long
lngBrowseWidth = ActiveWindow.ActivePane.BrowseWidth

Document returns a Document object associated with the specified pane.

Dim docDocument As Document
Set docDocument = ActiveWindow.ActivePane.Document

Frameset returns a Frameset object that represents an entire frames page or a single frame on a frames page.

Dim frmFrameset As Frameset
Set frmFrameset = ActiveWindow.ActivePane.Frameset

HorizontalPercentScrolled returns or sets the horizontal scroll position as a percentage of the document width.

ActiveWindow.ActivePane.HorizontalPercentScrolled =

Index returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = ActiveWindow.ActivePane.Index

MinimumFontSize returns or sets the minimum font size (in points) displayed for the specified pane.

ActiveWindow.ActivePane.MinimumFontSize =

Next returns a Pane object that represents the next document pane in the collection.

Dim panNext As Pane
Set panNext = ActiveWindow.ActivePane.Next

Parent returns an object that represents the parent object of the specified Pane object.

Dim objParent As Object
Set objParent = ActiveWindow.ActivePane.Parent

Previous returns a Pane object that represents the previous document pane in the collection.

Dim panPrevious As Pane
Set panPrevious = ActiveWindow.ActivePane.Previous

Selection returns the Selection object that represents a selection or the insertion point within a document pane.

Dim slcSelection As Selection
Set slcSelection = ActiveWindow.ActivePane.Selection

VerticalPercentScrolled returns or sets the vertical scroll position as a percentage of the document length.

ActiveWindow.ActivePane.VerticalPercentScrolled =

View returns a View object that represents the view for the specified pane.

Dim vwView As View
Set vwView = ActiveWindow.ActivePane.View

Zooms returns a Zooms collection that represents the magnification options for each view (such as normal view, outline view or print layout view).

Dim zmsZooms As Zooms
Set zmsZooms = ActiveWindow.ActivePane.Zooms

Panes.Count returns a Long that represents the number of panes in the collection.

Dim lngCount As Long
lngCount = ActiveWindow.Panes.Count

Panes.Parent returns an object that represents the parent object of the specified Panes object.

Dim objParent As Object
Set objParent = ActiveWindow.Panes.Parent