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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.