Opening Password Protected Word Document in OLE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can a password be provided to any password protected document while
opening in an OLE object?
 
¤ How can a password be provided to any password protected document while
¤ opening in an OLE object?

There is a password property in the Open method of the Documents collection:

Dim objWord As Word.Application
Dim objDocument As Word._Document

objWord = CreateObject("Word.Application")
objDocument = objWord.Documents.Open(FileName:="C:\Test Files\Test1.doc",
PasswordDocument:="password")
'...
'...
objDocument.Close()
objDocument = Nothing
objWord.Quit()
objWord = Nothing


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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

Back
Top