ActiveWindow Property
TOC
Collapse the table of content
Expand the table of content

Document.ActiveWindow Property (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a Window object that represents the active window (the window with the focus). Read-only.

expression .ActiveWindow

expression A variable that represents a Document object.

If there are no windows open, using the ActiveWindow property generates an error occurs.

This example displays the caption text for the active window.

Sub WindowCaption() 
 MsgBox ActiveDocument.ActiveWindow.Caption 
End Sub

This example opens a new window for the active window of the active document and then tiles all the windows.

Sub WindowTiled() 
 Dim wndTileWindow As Window 
 
 Set wndTileWindow = ActiveDocument.ActiveWindow.NewWindow 
 Windows.Arrange ArrangeStyle:=wdTiled 
End Sub

This example splits the first document window.

Sub WindowSplit() 
 Documents(1).ActiveWindow.Split = True 
End Sub
Show:
© 2016 Microsoft