View Object
TOC
Collapse the table of content
Expand the table of content

View Object (Publisher)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Contains the view attributes (show all, field shading, table gridlines, and so on) for a window or pane.

Use the ActiveView property to return the View object. The following example specifies the zoom setting.

Sub ZoomFitSelection() 
 ActiveDocument.ActiveView.Zoom = pbZoomFitSelection 
End Sub

The following examples zoom in and out, respectively, on the active view.

Sub ViewZoomIn() 
 ActiveDocument.ActiveView.ZoomIn 
End Sub 
 
Sub ViewZoomOut() 
 ActiveDocument.ActiveView.ZoomOut 
End Sub

The following example scrolls the active view to the specified shape.

Sub ScrollToShape() 
 Dim shpOne As Shape 
 
 Set shpOne = ActiveDocument.Pages(1).Shapes(1) 
 ActiveDocument.ActiveView.ScrollShapeIntoView Shape:=shpOne 
End Sub
Show:
© 2016 Microsoft