VBA/Excel/Access/Word/Application/ActiveWindow — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:46, 26 мая 2010
Содержание
- 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
<source lang="vb">
"ppViewHandoutMaster, ppViewMasterThumbnails, ppViewNormal, ppViewNotesMaster, ppViewNotesPage, ppViewOutline, ppViewPrintPreview, ppViewSlide, ppViewSlideMaster, ppViewSlideSorter, ppViewThumbnails, or ppViewTitleMaster. Sub view()
ActiveWindow.ViewType=ppViewSlideSorter
End Sub
</source>
Get the Usable Height and Width
<source lang="vb">
Sub GetActiveWindowUsableHeightWidth()
MsgBox ActiveWindow.UsableHeight MsgBox ActiveWindow.UsableWidth
End Sub
</source>
Opening a New Window
<source lang="vb">
Sub newWindow()
ActiveWindow.NewWindow
End Sub
</source>
Positioning and Sizing a Window: set its Left and Top properties
<source lang="vb">
Sub pos()
ActiveWindow.Left = 100 ActiveWindow.Top = 200
End Sub
</source>
scrolls the active window up two screens
<source lang="vb">
Sub scroll()
ActiveWindow.LargeScroll Up:=2
End Sub
</source>
Splitting a Window 70 percent of the way down the window:
<source lang="vb">
Sub split()
With ActiveWindow .Split = True .SplitVertical = 70 End With
End Sub
</source>
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:
<source lang="vb">
Sub map()
ActiveWindow.DocumentMap = True
End Sub
</source>
Toggle Gridlines
<source lang="vb">
Sub ToggleGridlines()
ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub
</source>
Toggle Headings
<source lang="vb">
Sub ToggleHeadings()
ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings
End Sub
</source>
To remove the split from the window, set the Split property to False:
<source lang="vb">
Sub remove()
ActiveWindow.Split = False
End Sub
</source>
To size a window, set its Height and Width properties:
<source lang="vb">
Sub size()
With ActiveWindow .Height = 300 .width = 400 End With
End Sub
</source>
Working with Panes
<source lang="vb">
Sub pane()
With ActiveWindow .ViewType = ppViewSlide .Panes(1).Activate End With
End Sub
</source>
Zooms the active window to 150 percent:
<source lang="vb">
Sub zoom()
ActiveWindow.View.Zoom = 150
End Sub
</source>