Class Zoom (Word VBA)
Contains magnification options (for example, the zoom percentage) for a window or pane. The Zoom object is a member of the Zooms collection. To use a Zoom class variable it first needs to be instantiated, for example
For Each
Here is an example of processing the Zoom items in a collection.
Dim pan As Pane: Set pan =
Dim zoo As Zoom
For Each zoo In pan.Zooms
With zoo
End With
Next zoo
PageColumns
Returns or sets the number of pages to be displayed side by side on-screen at the same time in print layout view or print preview.
With ActiveDocument.ActiveWindow.View
.Type = wdPrintView
.Zoom.PageColumns = 2
.Zoom.PageRows = 1
End With
PageFit
Returns or sets the view magnification of a window so that either the entire page is visible or the entire width of the page is visible. Possible return values are wdPageFitBestFit - Best fit the page to the active window, wdPageFitFullPage - View the full page, wdPageFitNone - Do not adjust the view settings for the page, wdPageFitTextFit - Best fit the text of the page to the active window.
The wdPageFitFullPage constant has no effect if the document isn't in print view. When the PageFit property is set to wdPageFitBestFit, the zoom percentage is automatically recalculated every time the document window size is changed. Setting this property to wdPageFitNone keeps the zoom percentage from being recalculated whenever this happens.
With Windows("Letter.doc").View
.Type = wdNormalView
.Zoom.PageFit = wdPageFitBestFit
End With
PageRows
Returns or sets the number of pages to be displayed one above the other on-screen at the same time in print layout view or print preview.
PrintPreview = True
With ActiveDocument.ActiveWindow.View.Zoom
.PageColumns = 1
.PageRows = 2
End With
Percentage
Returns or sets the magnification for a window as a percentage.
With ActiveDocument.ActiveWindow.View
.Type = wdNormalView
.Zoom.Percentage = 80
End With