I've been researching this for quite a while and can't find a solution. I'm opening a password protected word document and trying to save it in a pdf format. I can do this easily on a non-password protected document:
Dim objWord As Word.Document
Set objWord = GetObject("c:\temp\test.doc", "Word.Document")
objWord.Application.Visible = True
objWord.SaveAs "c:\temp\test.pdf", 17
objWord.Application.Quit
The trouble begins when I add a password. I couldn't find a way to open the password protected word document using GetObject, so I changed the code as follows:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open "c:\temp\test.doc", , , , PasswordDocument:="test"
objWord.Visible = True
objWord.Activate
objWord.Documents.Save
The code above works perfect fine if I want to just save the document in it's current state and not convert to a pdf file. Honestly, I can't even figure out how to do a objword.documents.saveas for the code above. Everything I try comes back with errors. Too many to mention
.
Does anyone have any insight on this issue?
Dim objWord As Word.Document
Set objWord = GetObject("c:\temp\test.doc", "Word.Document")
objWord.Application.Visible = True
objWord.SaveAs "c:\temp\test.pdf", 17
objWord.Application.Quit
The trouble begins when I add a password. I couldn't find a way to open the password protected word document using GetObject, so I changed the code as follows:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open "c:\temp\test.doc", , , , PasswordDocument:="test"
objWord.Visible = True
objWord.Activate
objWord.Documents.Save
The code above works perfect fine if I want to just save the document in it's current state and not convert to a pdf file. Honestly, I can't even figure out how to do a objword.documents.saveas for the code above. Everything I try comes back with errors. Too many to mention

Does anyone have any insight on this issue?