![]() |
#4
|
|||
|
|||
![]()
Not really. The thing is that Word puts things in layers or containers.
See the example given by Graham Mayor here: Installing Macros. I believe that the following is the most thorough macro to do this that I've encountered. It comes from Greg Maxey in this thread. Code:
Sub UpdateAllFieldsAllStoryMaxey() ' Greg Maxey ' 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=5 Dim rngStory As Word.Range Dim lngJunk As Long Dim oShp As Shape Dim oToc As TableOfContents, oToa As TableOfAuthorities, oTof As TableOfFigures 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 'Special Cases For Each oToc In ActiveDocument.TablesOfContents oToc.Update Next oToc For Each oToa In ActiveDocument.TablesOfAuthorities oToa.Update Next For Each oTof In ActiveDocument.TablesOfFigures oTof.Update Next Next End Sub My experience, though, is that StyleRef fields update instantly when in a header or footer. I believe that this is true when they are in the body of a document as well but am not certain. I do know that they update much better than do REF fields. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Mobius | Word | 3 | 05-06-2016 12:46 AM |
Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
![]() |
robstark | Word | 1 | 08-11-2014 11:26 AM |
Extract form fields to Word Document | RonNCmale | Word VBA | 22 | 01-11-2014 05:06 AM |
![]() |
LAssist2011 | Word | 5 | 12-14-2011 03:02 PM |