ProtectedViewWindows.Open (Word)

Opens the specified document in a new Protected View window.

Avoid using hard-coded passwords in your applications. If a password is required in a procedure, request the password from the user, store it in a variable, and then use the variable in your code.

Syntax : expression.Open (FileName, AddToRecentFiles, PasswordDocument, Visible, OpenAndRepair)

ProtectedViewWindows.Open FileName:="C:\MyFiles\MyDoc.doc" 

Arguments

The following argument is required

FileName (String) - The name of the document (paths are accepted).

The following arguments are optional

AddToRecentFiles (Boolean) - True to add the file name to the list of recently used files at the bottom of the File menu.

PasswordDocument (String) - The password for opening the document.

Visible (Boolean) - True if the document is opened in a visible window. The default value is True.

OpenAndRepair (Boolean) - True to repair the document to prevent document corruption.