Display/Show related procedures in class View (Word VBA)

This page presents procedures from class View related to the theme Display/Show: DisplayBackgrounds, DisplayPageBoundaries, ShowAll, ShowAllHeadings, ShowBookmarks, ShowComments, ShowCropMarks, ShowDrawings, ShowFieldCodes, ShowFirstLineOnly, ShowFormatChanges, ShowHeading, ShowHiddenText, ShowHighlight, ShowHyphens, ShowInkAnnotations, ShowInsertionsAndDeletions, ShowMainTextLayer, ShowObjectAnchors, ShowOptionalBreaks, ShowOtherAuthors, ShowParagraphs, ShowRevisionsAndComments, ShowSpaces, ShowTabs and ShowTextBoundaries

DisplayBackgrounds

Returns or sets a Boolean that represents whether background colors and images are shown when a document is displayed in print layout view.

Corresponds to the Background colors and images (Print view only) option located on the View tab of the Options dialog box.

ActiveDocument.ActiveWindow.View.DisplayBackgrounds = False

DisplayPageBoundaries

True to display the top and bottom margins (white space) and the gray area (gray space) between pages in a document.

False to hide from view the white and gray space so that the pages flow together as one long page. The default value is True. This feature is only available in the Print Layout view and only affects the gray space on the top and bottom of a page, not the left and right sides of a page. This setting affects the document in the in the specified window. When the document is saved, the state of this setting is saved with it.

Sub WhiteSpace() 
 With ActiveWindow.View 
 .Type = wdPrintView 
 .DisplayPageBoundaries = False 
 End With 
End Sub

ShowAll

True if all nonprinting characters (such as hidden text, tab marks, space marks, and paragraph marks) are displayed.

ActiveDocument.ActiveWindow.View.ShowAll = True

ShowAllHeadings

Switches between showing all text (headings and body text) and showing only headings.

This method generates an error if the view isn't outline view or master document view.

With ActiveDocument.ActiveWindow.View 
 .Type = wdOutlineView 
 .ShowHeading 9 
 .ShowAllHeadings 
End With

ShowBookmarks

True if square brackets are displayed at the beginning and end of each bookmark.

For Each aWindow In Windows 
 aWindow.View.ShowBookmarks = True 
Next aWindow

ShowComments

True for Microsoft Word to display the comments in a document.

If revision marks are displayed in balloons in the right or left margin, comments are displayed in balloons. If revision marks are displayed inline, the text to which comments apply is surrounded by wide-angled square brackets; when a user places the mouse pointer over the text within the brackets, the related comment is displayed in a square balloon directly above the mouse pointer.

Sub HideComments() 
 ActiveWindow.View.ShowComments = False 
End Sub

ShowCropMarks

Returns or sets a Boolean that represents whether to show crop marks in the corners of pages to indicate where margins are located.

Displaying crop marks does not allow a user to change the margins by dragging the crop marks. Crop marks are only displayed to indicate where margins are located in the page. This property corresponds to the Crop marks check box in the Advanced tab of the Word Options dialog box.

ActiveWindow.View.ShowCropMarks = True

ShowDrawings

True if objects created with the drawing tools are displayed in print layout view.

With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .ShowDrawings = True 
End With

ShowFieldCodes

True if field codes are displayed.

Windows("Document1").View.ShowFieldCodes = False

ShowFirstLineOnly

True if only the first line of body text is shown in outline view.

This property generates an error if the view isn't outline or master document view.

With ActiveDocument.ActiveWindow.View 
 .Type = wdOutlineView 
 .ShowFirstLineOnly = True 
End With

ShowFormatChanges

True for Microsoft Word to display formatting changes made to a document with Track Changes enabled.

Sub HideFormattingChanges() 
 ActiveWindow.View.ShowFormatChanges = False 
End Sub

ShowHeading

Shows all headings up to the specified heading level and hides subordinate headings and body text.

This method generates an error if the view isn't outline view or master document view.

Syntax : expression.ShowHeading (Level)

Level: The outline heading level (a number from 1 to 9).

With ActiveDocument.ActiveWindow.View 
 .Type = wdOutlineView 
 .ShowHeading 1 
End With

ShowHiddenText

True if text formatted as hidden text is displayed.

For Each myWindow In Windows 
 myWindow.View.ShowHiddenText = False 
Next myWindow

ShowHighlight

True if highlight formatting is displayed and printed with a document.

ActiveDocument.ActiveWindow.View.ShowHighlight = _ 
 Not ActiveDocument.ActiveWindow.View.ShowHighlight

ShowHyphens

True if optional hyphens are displayed. An optional hyphen indicates where to break a word when it falls at the end of a line.

Selection.InsertBefore Chr(31) 
ActiveDocument.ActiveWindow.View.ShowHyphens = True

ShowInkAnnotations

Returns or sets Boolean that shows or hides handwritten ink annotations. True displays ink annotations. False hides ink annotations.

To work with ink annotations, you must be running Microsoft Word on a tablet computer. For more information on adding handwritten ink annotations to a document, see "Mark up a document with ink annotations" in Microsoft Word Help.

ActiveDocument.ActiveWindow.View.ShowInkAnnotations = True

ShowInsertionsAndDeletions

True for Microsoft Word to display insertions and deletions that were made to a document with Track Changes enabled.

Sub HideInsertDelete() 
 ActiveWindow.View.ShowInsertionsAndDeletions = False 
End Sub

ShowMainTextLayer

True if the text in the specified document is visible when the header and footer areas are displayed. This property is equivalent to the Show/Hide Document Text button on the Header and Footer toolbar.

With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .SeekView = wdSeekCurrentPageHeader 
 .ShowMainTextLayer = False 
End With

ShowObjectAnchors

True if object anchors are displayed next to items that can be positioned in print layout view.

Selection.Frames.Add(Range:=Selection.Range).LockAnchor = True 
With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .ShowObjectAnchors = True 
End With

ShowOptionalBreaks

True if Microsoft Word displays optional line breaks.

ActiveDocument.ActiveWindow.View.ShowOptionalBreaks = True

ShowOtherAuthors

True if other authors' presence should be visible in the document.

By default, when Word other authors are editing or have blocked off a section of the document. Use the ShowOtherAuthors property to toggle showing other authors' presence while co authoring.

ActiveWindow.View.ShowOtherAuthors = True

ShowParagraphs

True if paragraph marks are displayed.

ActiveDocument.ActiveWindow.View.ShowParagraphs = False

ShowRevisionsAndComments

True for Microsoft Word to display revisions and comments that were made to a document with Track Changes enabled.

Sub ShowRevsComments() 
 ActiveWindow.View.ShowRevisionsAndComments = False 
End Sub

ShowSpaces

True if space characters are displayed.

Selection.InsertBefore " " 
ActiveDocument.ActiveWindow.View.ShowSpaces = True

ShowTabs

True if tab characters are displayed.

With Windows("Document2") 
 .Activate 
 .View.ShowTabs = True 
End With 
Selection.InsertBefore vbTab 
Selection.Collapse Direction:=wdCollapseEnd

ShowTextBoundaries

True if dotted lines are displayed around page margins, text columns, objects, and frames in print layout view.

With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .ShowTextBoundaries = True 
End With