Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    May 2014
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Forms Being Reset When Document Unprotected/Protected in Macro

    I have a document that has form fields the user fills in. The document has editing restrictions to allow the user to only fill in the form fields. When I use a macro to Unprotect and then Protect the document, the data the user has filled in in the form fields gets erased and the form fields revert back to the placeholders, erasing any data previously added.

    For Example:

    City: { FORMTEXT } State: { FORMTEXT } Zip Code: { FORMTEXT }

    When the document is protected, the user can tab from form field to form field and fill in the data. I need to Unprotect the document in a macro to work with some of the data, but when I then Protect the document using the same Macro using ActiveDocument.Protect (wdAllowOnlyFormFields), the data previously entered is erased. The form fields are still there and can be filled in again. This doesn't happen if I just Protect/Unprotect/Protect the document from within Word, or if I use ActiveDocument.Protect(wdAllowOnlyReading) in a macro. It only happens when I use the wdAllowOnlyFormFields protection in a macro. Any ideas why this would be happening when using a macro? Any solutions? Thanks for your help!
    Last edited by RandyMc; 2014-05-18 at 02:10. Reason: Clarification

  2. #2
    New Lounger
    Join Date
    May 2014
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Problem solved in another thread.

Tags for this Thread

Posting Permissions

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