WindowNumber Property

Microsoft Word Visual Basic

expression.WindowNumber

expression    Required. An expression that returns a Window object.

Remarks

Use the Index property to return the number of the specified window in the Windows collection.

Example

This example retrieves the window number of the active window, opens a new window, and then activates the original window.

Sub WinNum()
    Dim lwindowNum As Long

    lwindowNum = ActiveDocument.ActiveWindow.WindowNumber
    NewWindow
    ActiveDocument.Windows(lwindowNum).Activate
End Sub