![]() |
|
|
|
#1
|
|||
|
|||
|
You can update all fields in a document by calling the following macro from your dropdown change event:
Public Sub UpdateAllFields() Dim rngStory As Word.Range Dim lngJunk As Long Dim oShp As Shape lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype 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 Next End Sub |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
ASK and REF field problem
|
ilkks | Word | 3 | 05-26-2011 01:58 AM |
| How to refer a field in another field | DaveSmith | Word | 0 | 08-24-2010 06:44 PM |
| Field Help | BChianciola | Word | 0 | 11-09-2009 01:14 PM |
| Infopath field | mjv | Misc | 0 | 12-27-2008 08:19 AM |
| Printing BCC field | John Strung | Outlook | 4 | 11-22-2005 04:48 PM |