Panes 集合对象

         
Windows (Window)
Panes (Pane)
多种对象

Pane 对象组成的集合,代表一个窗口中的窗格。

使用 Panes 集合

可用 Panes 属性返回 Panes 集合。下例拆分活动窗口并隐藏每个窗格的标尺。

ActiveDocument.ActiveWindow.Split = True
For Each aPane In ActiveDocument.ActiveWindow.Panes
    aPane.DisplayRulers = False
Next aPane

可用 Add 方法或 Split 属性添加一个窗格。下例按活动窗口尺寸的 20% 拆分活动窗口。

ActiveDocument.ActiveWindow.Panes.Add SplitVertical:=20

下例平分活动窗口。

ActiveDocument.ActiveWindow.Split = True

可用 SplitSpecial 属性显示一个独立窗格的备注、脚注或尾注。

说明

当窗口被拆分或在非页面视图下显示脚注、注释等信息时,窗口具有多个窗格。下例在普通视图中显示备注窗格,然后提示关闭该窗格。

ActiveDocument.ActiveWindow.View.Type = wdNormalView
If ActiveDocument.Footnotes.Count >= 1 Then
    ActiveDocument.ActiveWindow.View.SplitSpecial = wdPaneFootnotes
    response = _
        MsgBox("Do you want to close the footnotes pane?", vbYesNo)
    If response = vbYes Then _
        ActiveDocument.ActiveWindow.ActivePane.Close
End If