WindowNumber Property

Applies To

Window object.

Description

Returns the window number of the document displayed in the specified window. For example, if the caption of the window is "Sales.doc:2," this property returns the number 2. Read-only Long.

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

See Also

Index property.

Example

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

windowNum = ActiveDocument.ActiveWindow.WindowNumber
NewWindow
ActiveDocument.Windows(windowNum).Activate