Class ProtectedViewWindow (Word VBA)

The class ProtectedViewWindow represents a Protected View window.

The main procedures of class ProtectedViewWindow are Activate, Close and ProtectedViewWindows.Open

Set

To use a ProtectedViewWindow class variable it first needs to be instantiated, for example

Dim pvw as ProtectedViewWindow
Set pvw = ActiveProtectedViewWindow

The following procedures can be used to set variables of type ProtectedViewWindow: Application.ActiveProtectedViewWindow, ProtectedViewWindows.Item, ProtectedViewWindows.Open and Application.ProtectedViewWindows

For Each

Here is an example of processing the ProtectedViewWindow items in a collection.

Dim pvw As ProtectedViewWindow
For Each pvw In ProtectedViewWindows
	
Next pvw

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Name with its procedures Caption and SourceName

Methods

These are the main methods of the ProtectedViewWindow class

Activate - Activates the specified Protected View window.

ActiveProtectedViewWindow.Activate

Close - Closes the specified Protected View window.

ActiveProtectedViewWindow.Close

ProtectedViewWindows.Open - Opens the specified document in a new Protected View window.

Dim strFileName As String: strFileName =  
Dim pvw As ProtectedViewWindow
Set pvw = ProtectedViewWindows.Open(FileName:=strFileName)

Other Methods

Edit - expression.Edit (PasswordTemplate, WritePasswordDocument, WritePasswordTemplate)

Dim doc As Document
Set doc = ActiveProtectedViewWindow.Edit()

Properties

Active true if the specified Protected View window is active.

Dim booActive As Boolean
booActive = ActiveProtectedViewWindow.Active

Document returns a Document object associated with the Protected View window.

Dim docDocument As Document
Set docDocument = ActiveProtectedViewWindow.Document

Height returns or sets the height of the Protected View window.

ActiveProtectedViewWindow.Height =

Index returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = ActiveProtectedViewWindow.Index

Left returns or sets a Long, in points, that represents the horizontal position of the specified Protected View window.

ActiveProtectedViewWindow.Left =

Parent returns an object that represents the parent object of the specified ProtectedViewWindow object.

Dim objParent As Object
Set objParent = ActiveProtectedViewWindow.Parent

SourcePath returns the path of the source file for the specified Protected View window.

Dim strSourcePath As String
strSourcePath = ActiveProtectedViewWindow.SourcePath

Top returns or sets the vertical position, in points, of the specified Protected View window. Read/write Long

ActiveProtectedViewWindow.Top =

Visible true if the specified Protected View window is visible. Read/write.

ActiveProtectedViewWindow.Visible = True

Width returns or sets the width, in points, of the specified Protected View window.

ActiveProtectedViewWindow.Width =

WindowState returns or sets the state of the specified Protected View window.

ActiveProtectedViewWindow.WindowState = wdWindowStateMaximize

ProtectedViewWindows.Count returns a Long that represents the number of Protected View windows in the collection.

Dim lngCount As Long
lngCount = ProtectedViewWindows.Count

ProtectedViewWindows.Parent returns an object that represents the parent object of the specified ProtectedViewWindows object.

Dim objParent As Object
Set objParent = ProtectedViewWindows.Parent