DocumentBase.ActiveWindow 属性

定义

获取一个表示活动窗口的 Window

public Microsoft.Office.Interop.Word.Window ActiveWindow { get; }

属性值

Window

一个表示活动窗口的 Window

示例

下面的代码示例拆分活动窗口。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

private void DocumentActiveWindow()
{
    this.ActiveWindow.Split = true;
}
Private Sub DocumentActiveWindow()
    Me.ActiveWindow.Split = True
End Sub

注解

活动窗口是当前具有焦点的窗口。

如果未打开任何窗口,则会引发异常。

适用于