• Macro to protect form (Word 97)

    Author
    Topic
    #367185

    Once again I’m in over my head. With some help, I’ve written a macro to automatically increment a form number in a Word 97 template. The numbering works fine. What isn’t working is the protection. I protected the template using the Tools – Protect Document option. When I open the template, it is protected. When I open a document based on the template, the document is not protected. Since this is a form, I need the protection activated so the users can only enter information into the form fields.

    Can anyone tell me the coding that I’d use withing my macro to protect the document (no password) and if the protection should go before or after the incremental numbering code in the macro?

    Viewing 0 reply threads
    Author
    Replies
    • #571812

      Just to let you know, I figured out the macro code needed to protect my form without my autonumbering being wiped out.

      • #571903

        This switches the protection off:

        ActiveDocument.Unprotect

        This switxches it on:

        ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

        David

    Viewing 0 reply threads
    Reply To: Macro to protect form (Word 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: