Update multiple field in Protected Restrict Editing Word Document

Anonymous
2020-07-03T10:30:58+00:00

Dear Sir,

I have word document which has multiple fields. We are using ASK field and LINK Excel.sheet.12 (for some data extract from Excel to Word). In my word document, there is also some Exceptions (for editing). Now my problem is

  1. How to update my all fields in protected Restrict Editing Word Document.
  2. I don't want to unprotect my document or share password to our users
  3. After updating all fields, user can enable to edit in Exceptions area only rest of other part must have unable to edit

Thanking You

Afzal

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2020-07-09T03:31:31+00:00

    What type of Editing Restriction did you apply to the document?

    With some of them, it is not possible to run macros from the user interface so you would need to assign the macro to the keyboard or to the Quick Access Toolbar.

    Alternatively, if you use FIle>Print and then close the backstage print view, that will cause the fields in the document to be updated.

    Hi Doug,

    Whenever I run below macro - (.Execute Replace:=wdReplaceAll) this line showing error.

    Sub ChangeLinkPath()

        Dim rg As Range

        Set rg = ActiveDocument.Range

        rg.TextRetrievalMode.IncludeFieldCodes = True

        With rg.Find

            .Text = InputBox("Old path and file name", "Old Path and File Name")

            .Replacement.Text = InputBox("New path and file name", "New Path and File Name")

            .Execute Replace:=wdReplaceAll

        End With

        ActiveDocument.Fields.Update

    End Sub

    and I am using this mode for restrict editing, comments and wherever I selected Exceptions, that area only editable. Rest of the document editing locked. User have only rights to give comments and Edit only in Exception area.

    If I am not choosing Start Enforcing Protection, these macro run perfectly but I need password for the document. And after I choose Yes, Start Enforcing Protection and insert password, these macro showing error "4605", and  .Execute Replace:=wdReplaceAll line showing error.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-07-09T03:21:56+00:00

    Which fields are you trying to update? A single line of code should do the trick:

    ActiveDocument.Fields.Update

    Which line in the macro generates the error?

    Hi Stefan,

    Whenever I run below macro - (.Execute Replace:=wdReplaceAll,) this line showing error

    Sub ChangeLinkPath()

        Dim rg As Range

        Set rg = ActiveDocument.Range

        rg.TextRetrievalMode.IncludeFieldCodes = True

        With rg.Find

            .Text = InputBox("Old path and file name", "Old Path and File Name")

            .Replacement.Text = InputBox("New path and file name", "New Path and File Name")

            .Execute Replace:=wdReplaceAll

        End With

        ActiveDocument.Fields.Update

    End Sub

    and I am using this mode for restrict Editing, Comments and wherever I selected Exceptions, that area only editable. Rest of the document editing locked. User have only rights to give comments and Edit only in Exception area.

    If I not choosing Start Enforcing Protection, these macro run perfectly but I need password for the document. and after I choose Yes, Start Enforcing Protection and insert password, these macro showing error "4605". and .Execute Replace:=wdReplaceAll line showing error.   

    Was this answer helpful?

    0 comments No comments
  5. Doug Robbins - MVP - Office Apps and Services 323.5K Reputation points MVP Volunteer Moderator
    2020-07-08T22:15:48+00:00

    What type of Editing Restriction did you apply to the document?

    With some of them, it is not possible to run macros from the user interface so you would need to assign the macro to the keyboard or to the Quick Access Toolbar.

    Alternatively, if you use FIle>Print and then close the backstage print view, that will cause the fields in the document to be updated.

    Was this answer helpful?

    0 comments No comments