View Full Version : Open password protected document


TRM
03-15-2006, 08:46 PM
I am trying to use VBA to open a password protected document for editing. I
have tried putting the password in the code after the open statement
(odoc.password = "password"). But, of course, this is opening the document
first, and not checking/seeing the password, so the user is still prompted.
Is there a way to do this?

Thanks!

Tony Jollans
03-16-2006, 02:58 PM
The Open method has several password options - depending on the type of
password, simply ..

Documents.Open FileName:="C:\path\file.doc", PasswordDocument:="whatever"

--
Enjoy,
Tony

"TRM" <TRM@discussions.microsoft.com> wrote in message
news:E11846EF-DE61-4625-86BB-26618EFCA780@microsoft.com...
> I am trying to use VBA to open a password protected document for editing.
I
> have tried putting the password in the code after the open statement
> (odoc.password = "password"). But, of course, this is opening the
document
> first, and not checking/seeing the password, so the user is still
prompted.
> Is there a way to do this?
>
> Thanks!