code to facilitate opening locked documents

G

gils usenet acct

I am seeking code to the "open a file" dialog with a password already in
normal.dot and a variable for file name.

I assume it would be something like:

' in an open Word file, type 5 letters of the file name to be opened,
then set it as the variable "Xname"

Selection.MoveLeft Unit:=wdCharacter, Count:=5, Extend:=wdExtend

Dim Xname As String

Xname = Selection.Text

Documents.Open FileName:="Xname", ConfirmConversions:= _

False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="myPassword123412341241234", _

PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _

WritePasswordTemplate:="", Format:=wdOpenFormatAuto

I am seeking faster file opening.

tia

Gil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top