Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jan Kratochvil Jan Kratochvil is offline
external usenet poster
 
Posts: 52
Default Updating all Fields in Word Document

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
  #2   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



  #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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating fields in Word Mac Microsoft Word Help 1 April 10th 09 06:45 AM
Updating all fields within a document RN Microsoft Word Help 2 September 19th 08 06:39 AM
Updating document fields increases the size of the Word document S Beckman Microsoft Word Help 2 June 22nd 07 06:17 AM
Fields in one document updating other documents Steve N Microsoft Word Help 3 October 18th 05 11:35 PM
Why not all fields in document are updating? Elena Microsoft Word Help 9 September 1st 05 03:21 PM


All times are GMT +1. The time now is 07:18 PM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"