• Protect form fields in Word using code

    Author
    Topic
    #351850

    I need to protect form fields in Word using code.

    I tried setting Word VBA’s ProtectedForForms property to true. That did absolutely nothing. My form fields still weren’t protected. When I then tried recording a macro with the “Protect Form” command from Word’s Form toolbar, no code got generated. Absolutely beautiful.

    Does anyone have the workaround to this one?

    Thanks.

    Stephan

    Viewing 0 reply threads
    Author
    Replies
    • #510274

      Try:

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

      Protecting a form turns the macro recording off, that’s why you don’t see the command executed

    Viewing 0 reply threads
    Reply To: Protect form fields in Word using code

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

    Your information: