VBA/Excel/Access/Word/Application/ActiveWindow — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 12:46, 26 мая 2010

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