View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Updating all Fields in Word Document

Sub UpdateAllFields()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub

Appears to work on text boxes in a drawing canvas.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Jan Kratochvil" wrote in message
...
I need to update all fields in the Word document.
I have some of the fields in drawing canvas too.

I have tried this, which works fine, but except drawing canvas.
http://word.tips.net/Pages/T003879_U..._Text_Box.html

Thank you
--
Regards
Jan Kratochvil
Windows Vista Business SP2, Office 2007 SP 2