G Guest Jun 26, 2006 #1 How can a password be provided to any password protected document while opening in an OLE object?
P Paul Clement Jun 26, 2006 #2 ¤ 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)
¤ 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)