Window object (Word)
Represents a window. Many document characteristics, such as scroll bars and rulers, are actually properties of the window.
Remarks
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.
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
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.
Methods
Name |
---|
Activate |
Close |
GetPoint |
LargeScroll |
NewWindow |
PageScroll |
PrintOut |
RangeFromPoint |
ScrollIntoView |
SetFocus |
SmallScroll |
ToggleRibbon |
Properties
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기