Opening Password Protected Word Document in OLE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Imtiaz Qamar

    #1

    Opening Password Protected Word Document in OLE

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

  • Paul Clement

    #2
    Re: Opening Password Protected Word Document in OLE

    On Sun, 25 Jun 2006 23:25:02 -0700, Imtiaz Qamar <ImtiazQamar@di scussions.micro soft.com> wrote:

    ¤ 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.Applicatio n
    Dim objDocument As Word._Document

    objWord = CreateObject("W ord.Application ")
    objDocument = objWord.Documen ts.Open(FileNam e:="C:\Test Files\Test1.doc ",
    PasswordDocumen t:="password")
    '...
    '...
    objDocument.Clo se()
    objDocument = Nothing
    objWord.Quit()
    objWord = Nothing


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

    Comment

    Working...