#1
|
|||
|
|||
Update captions when editing restrictions are enabled
Hello I have a Word 2010 document that has captions in it. The document also has editing restrictions enabled. I want users to be able to update all captions throughout the document simultaneously by pressing 'Ctrl+A' and then 'F9'. This method works when the editing restrictions are disabled. It also updates the Table of Contents, Table of Figures, and Cross References too. However, when the editing restrictions are turned on this method will not work to update the captions and other hyperlinks, etc.. Is there a way to make the simultaneous update for these items work? Please note that all captions are set up so that 'everyone' can edit them. Any pointers for solutions or troubleshooting are most appreciated. Best, MJP |
#2
|
||||
|
||||
If you're using formfields, checking each one's 'calculate on exit' property will achieve the desired result - without the need for Ctrl-A, F9 - except for the Table of Contents & Table of Figures. There is a convoluted workaround for those, too, however. That workaround involves putting each them at the end of the document, inside SET fields and, at where you want the Table of Contents & Table of Figures to appear, inserting a cross-reference to the relevant SET field's bookmark.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you. However, I don't think I am using form fields. I had a regular Word document with captions inserted and I added the editing restrictions by going to the developer tab, enabling restrictions, and highlighting the portions of text that I want the users to be able to change, and checking the 'everyone' box to allow anyone to change the highlighted text. Are captions the same as form fields? If not, is it possible to somehow update the captions as described above when I have this sort of setup? Thank you for the clarification
|
#4
|
|||
|
|||
Not without a macro. Will you be able to use macros where this will be used? If it is going out to remote locations you should not count on this.
No, although captions are Fields, they are not formfields. Last edited by Charles Kenyon; 02-15-2017 at 01:28 AM. |
#5
|
|||
|
|||
Yes, we will be able to use macros and the document will not be sent to remote locations. Can you please provide more information about how to use macros to accomplish this task? Thank you much.
|
#6
|
|||
|
|||
I'm sure that Paul or others could improve on this. You would include the password for modification in the UpdateCaptions routine. In this code, it is set as "xyz."
Code:
Sub protectDocNoMods(Str_password As String) ' ' ActiveDocument.Protect Password:=Str_password, _ NoReset:=False, Type:= _ wdAllowOnlyReading, _ UseIRM:=False, EnforceStyleLock:=False End Sub Sub UnprotectDocNoMods(Str_password As String) ' ActiveDocument.Unprotect (Str_password) End Sub Sub UpdateCaptions() Dim Str_password As String Str_password = "xyz" Call UnprotectDocNoMods(Str_password) ' From Greg Maxey 2013-09-30 ' http://answers.microsoft.com/en-us/office/forum/office_2007-word/how-to-update-all-fields-in-a-document-at-once/54b43181-0ea7-4abc-bfb9-e0555125dfe5?page=3 ' Dim rngStory As Word.Range, lngJunk As Long, oShp As Shape Dim oToc As TableOfContents, oTof As TableOfFigures, oToa As TableOfAuthorities ' lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType For Each rngStory In ActiveDocument.StoryRanges 'Iterate through all linked stories Do On Error Resume Next rngStory.Fields.Update Select Case rngStory.StoryType Case 6, 7, 8, 9, 10, 11 If rngStory.ShapeRange.Count > 0 Then For Each oShp In rngStory.ShapeRange If oShp.TextFrame.HasText Then oShp.TextFrame.TextRange.Fields.Update End If Next End If Case Else 'Do Nothing End Select On Error GoTo 0 'Get next linked story (if any) Set rngStory = rngStory.NextStoryRange Loop Until rngStory Is Nothing For Each oToc In ActiveDocument.TablesOfContents oToc.Update Next oToc For Each oTof In ActiveDocument.TablesOfFigures ' Added by CKK oTof.Update Next oTof ' For Each oToa In ActiveDocument.TablesOfAuthorities ' Added by CKK ' oToa.Update ' Next oToa Next ' Call protectDocNoMods(Str_password) ' End Sub |
#7
|
|||
|
|||
Thanks so much, Charles. I will try out this code, troubleshoot as necessary, and consult the link you provided. Thanks again.
|
Tags |
editing restrictions, update all, updating captions |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA to insert captions without appending to existing captions | Marrick13 | Word VBA | 17 | 03-21-2023 07:51 PM |
Update Userform Captions, TextBoxes, Command buttons From Excel | dan88 | Word VBA | 3 | 05-22-2016 08:59 AM |
Captions: Changing captions in Appendix update all captions | carnestw | Word | 3 | 10-27-2015 12:34 PM |
Need 2 embedded charts to update upon editing data in one | SRichardson | Excel | 1 | 02-19-2014 12:44 AM |
How to edit shape with "editing restrictions" turned on | jackj22 | Word | 2 | 03-05-2012 01:48 PM |