The View Object

A View object represents many of the viewing attributes of a contents of a window or pane. The View property of the Window or Pane object returns the View object.

The properties and methods of the View object are shown in the following list (I discuss just a few of these members):

Application

SeekView

ShowObjectAnchors

BrowseToWindow

ShowAll

ShowOptionalBreaks

CollapseOutline

ShowAllHeadings

ShowParagraphs

Creator

ShowAnimation

ShowPicturePlaceHolders

Draft

ShowBookmarks

ShowSpaces

EnlargeFontsLessThan

ShowDrawings

ShowTabs

ExpandOutline

ShowFieldCodes

ShowTextBoundaries

FieldShading

ShowFirstLineOnly

SplitSpecial

FullScreen

ShowFormat

TableGridlines

Magnifier

ShowHeading

Type

MailMergeDataView

ShowHiddenText

WrapToWindow

NextHeaderFooter

ShowHighlight

Zoom

Parent

ShowHyphens

 

PreviousHeaderFooter

ShowMainTextLayer

 

The Type Property

The Type property is used to set (or return) the view type. It can be set to any of the constants in the following enum:

	Enum WdViewType
	   wdNormalView = 1
	   wdOutlineView = 2
	   wdPageView = 3
	   wdPrintPreview = 4
	   wdMasterView = 5
	   wdOnlineView = 6
	End Enum

For instance, the following code sets the view for the active window to page layout:

	ActiveWindow.View.Type = wdPageView

The Show Properties

The View object has several properties that determine what items are visible in the window. Here is a partial list (note that all of the properties are read/write Boolean, unless stated otherwise):

The ShowAll property ...

Get Writing Word Macros, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.