VBA/Excel/Access/Word/Application/ActiveWindow
Содержание
- 1 Changing the View
- 2 Get the Usable Height and Width
- 3 Opening a New Window
- 4 Positioning and Sizing a Window: set its Left and Top properties
- 5 scrolls the active window up two screens
- 6 Splitting a Window 70 percent of the way down the window:
- 7 To display the Document Map for a window at the Document Map"s previous width percentage (of the document"s window), set the DocumentMap property to True:
- 8 Toggle Gridlines
- 9 Toggle Headings
- 10 To remove the split from the window, set the Split property to False:
- 11 To size a window, set its Height and Width properties:
- 12 Working with Panes
- 13 Zooms the active window to 150 percent:
Changing the View
"ppViewHandoutMaster, ppViewMasterThumbnails, ppViewNormal, ppViewNotesMaster, ppViewNotesPage, ppViewOutline, ppViewPrintPreview, ppViewSlide, ppViewSlideMaster, ppViewSlideSorter, ppViewThumbnails, or ppViewTitleMaster.
Sub view()
ActiveWindow.ViewType=ppViewSlideSorter
End Sub
Get the Usable Height and Width
Sub GetActiveWindowUsableHeightWidth()
MsgBox ActiveWindow.UsableHeight
MsgBox ActiveWindow.UsableWidth
End Sub
Opening a New Window
Sub newWindow()
ActiveWindow.NewWindow
End Sub
Positioning and Sizing a Window: set its Left and Top properties
Sub pos()
ActiveWindow.Left = 100
ActiveWindow.Top = 200
End Sub
scrolls the active window up two screens
Sub scroll()
ActiveWindow.LargeScroll Up:=2
End Sub
Splitting a Window 70 percent of the way down the window:
Sub split()
With ActiveWindow
.Split = True
.SplitVertical = 70
End With
End Sub
To display the Document Map for a window at the Document Map"s previous width percentage (of the document"s window), set the DocumentMap property to True:
Sub map()
ActiveWindow.DocumentMap = True
End Sub
Toggle Gridlines
Sub ToggleGridlines()
ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub
Toggle Headings
Sub ToggleHeadings()
ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings
End Sub
To remove the split from the window, set the Split property to False:
Sub remove()
ActiveWindow.Split = False
End Sub
To size a window, set its Height and Width properties:
Sub size()
With ActiveWindow
.Height = 300
.width = 400
End With
End Sub
Working with Panes
Sub pane()
With ActiveWindow
.ViewType = ppViewSlide
.Panes(1).Activate
End With
End Sub
Zooms the active window to 150 percent:
Sub zoom()
ActiveWindow.View.Zoom = 150
End Sub