Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 1.48 KB

Word.View.Type.md

File metadata and controls

67 lines (40 loc) · 1.48 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
View.Type property (Word)
vbawd10.chm161808384
vbawd10.chm161808384
Word.View.Type
0168c7cd-147f-b81b-2a56-3c3f751cc4b0
06/08/2017
medium

View.Type property (Word)

Returns or sets the view type. Read/write WdViewType.

Syntax

expression.Type

expression Required. A variable that represents a 'View' object.

Remarks

The Type property returns wdMasterView for all documents where the current view is an outline or a master document. The current view will never return wdOutlineView unless explicitly set first in code.

To check whether the current document is an outline, use the Type property and the Subdocuments collection's Count property. If the Type property returns either wdOutlineView or wdMasterView and the Count property returns zero, the document is an outline. For example:

Sub VerifyOutlineView() 
 With ActiveWindow.View 
 If .Type = wdOutlineView Or wdMasterView Then 
 If ActiveDocument.Subdocuments.Count = 0 Then 
 . 
 . 
 . 
 End If 
 End If 
 End With 
End Sub

Example

This example switches the active window to print preview. The Type property creates a new print preview window.

ActiveDocument.ActiveWindow.View.Type = wdPrintPreview

See also

View Object

[!includeSupport and feedback]