Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro To Password Protect Document (Worrd 2000 SR-1)

    Is it posssible to make a macro to password protect a document. I can do this by going to tools/options/save - password to modify.

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Macro To Password Protect Document (Worrd 2000 SR-1)

    Yes, it is.

    The simplest way is to turn the Macro Recorder on and then carry out the command the way you normally would. Then stop the recorder and see what you have created.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro To Password Protect Document (Worrd 2000 SR-1)

    When I tried to do this I tound that the Macro Recorder didn't record both places you have to enter the password. You need something like...

    <pre> ActiveDocument.WritePassword = txtPassword
    ActiveDocument.SaveAs WritePassword:=txtPassword
    </pre>


    StuartR

  4. #4
    New Lounger
    Join Date
    Feb 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro To Password Protect Document (Worrd 2000 SR-1)

    Thanks, that is what I was looking for. I needed the ActiveDocument.SaveAs WritePassword: = "xxxxxxx"

    otherwise, the macro would only work if I made a change to the document and then did a regular save.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •