Hi TC,
I didn't get any error message. The code didn't add the
password to my file.
Thanks.
Tim.
>-----Original Message-----
>
>FFTJIWUL!
>
>But, he wants to *add* a password to his files. Your
syntax is for opening a
>file with an existing password.
>
>To the original poster: what do you mean, "it doesn't
work"? What error
>message did you get?
>
>TC
>
>FFTJIWUL: feel free to jump in whenever you like!
>
>
>
>"Tim Ferguson" <(E-Mail Removed)> wrote in message
>news:Xns93F6ACD95D65garbleme4455656@207.46.248.16...
>> PMFJI
>>
>> "Tim" <(E-Mail Removed)> wrote in
>> news:027701c37ac8$219a15e0$(E-Mail Removed):
>>
>> >>
>> >>I don't have Word on this PC, to check.
>> >>
>> >>However, you might try this at the line in question:
>> >>
>> >> oWord.ActiveDocument.Password = "645bn&#$z!" ' <-
the
>> >> '
password.
>> > I tried the command but it doesn't work.
>> >
>> >
>> This is from Word help on the Open method:
>>
>> Syntax 1
>>
>> expression.Open(FileName, ConfirmConversions, ReadOnly,
AddToRecentFiles,
>> PasswordDocument, PasswordTemplate, Revert,
WritePasswordDocument,
>> WritePasswordTemplate, Format, Encoding, Visible)
>>
>> ...
>>
>> PasswordDocument Optional Variant. The password for
opening the
>document.
>>
>> PasswordTemplate Optional Variant. The password for
opening the
>template.
>>
>>
>> Hope that helps
>>
>>
>> Tim F
>
>
>
>.
>
|