O'Reilly logo

Writing Word Macros, Second Edition by Steven Roman PhD

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required