Window Object

Multiple objects
Window
Multiple objects

Represents a window. Many document characteristics, such as scroll bars and rulers, are actually properties of the window. The Window object is a member of the Windows collection. The Windows collection for the Application object contains all the windows in the application, whereas the Windows collection for the Document object contains only the windows that display the specified document.

Using the Window Object

Use Windows(index), where index is the window name or the index number, to return a single Window object. The following example maximizes the Document1 window.

Windows("Document1").WindowState = wdWindowStateMaximize

The index number is the number to the left of the window name on the Window menu. The following example displays the caption of the first window in the Windows collection.

MsgBox Windows(1).Caption

Use the Add method or the NewWindow method to add a new window to the Windows collection. Each of the following statements creates a new window for the document in the active window.

ActiveDocument.ActiveWindow.NewWindow
NewWindow
Windows.Add

Remarks

A colon (:) and a number appear in the window caption when more than one window is open for a document.

When you switch the view to print preview, a new window is created. This window is removed from the Windows collection when you close print preview.

Properties | Active Property | ActivePane Property | Application Property | Caption Property | Creator Property | DisplayHorizontalScrollBar Property | DisplayLeftScrollBar Property | DisplayRightRuler Property | DisplayRulers Property | DisplayScreenTips Property | DisplayVerticalRuler Property | DisplayVerticalScrollBar Property | Document Property | DocumentMap Property | DocumentMapPercentWidth Property | EnvelopeVisible Property | Height Property | HorizontalPercentScrolled Property | IMEMode Property | Index Property | Left Property | Next Property | Panes Property | Parent Property | Previous Property | Selection Property | Split Property | SplitVertical Property | StyleAreaWidth Property | Thumbnails Property | Top Property | Type Property | UsableHeight Property | UsableWidth Property | VerticalPercentScrolled Property | View Property | Visible Property | Width Property | WindowNumber Property | WindowState Property

Methods | Activate Method | Close Method | GetPoint Method | LargeScroll Method | NewWindow Method | PageScroll Method | PrintOut Method | RangeFromPoint Method | ScrollIntoView Method | SetFocus Method | SmallScroll Method | ToggleShowAllReviewers Method

Parent Objects | Application Object | Document Object | Global Object | Window Object

Child Objects | Document Object | Pane Object | Panes Object | Selection Object | View Object | Window Object