Fields in Text Boxes Don't Update

J

John Miller

I have a Word 2003 document containing references to bookmarks. When I select all, then hit F9, the references within text boxes don't update, but the rest do. The only way I can update the references in the text boxes is to select the reference and either right-click and select "update field" or hit F9. Why does this happen, and is there a way to achieve document-wide update of all fields? Thanks.

- John
 
J

Jezebel

Word handles field updating independently for each storyrange in the
document. The body of the document is one storyrange; the others are
textboxes, headers and footers, footnotes, endnotes, comments, and
textframes. F9 does only the document body. Updating fields wherever they
may be is a perennial VBA issue. If you don't want to write a macro to do
it, the next quickest method seems to be to print preview the document.



I have a Word 2003 document containing references to bookmarks. When I
select all, then hit F9, the references within text boxes don't update, but
the rest do. The only way I can update the references in the text boxes is
to select the reference and either right-click and select "update field" or
hit F9. Why does this happen, and is there a way to achieve document-wide
update of all fields? Thanks.

- John
 
C

Cindy M -WordMVP-

Hi John,
I have a Word 2003 document containing references to bookmarks. When I select all, then hit F9, the references within text boxes don't update, but the rest do. The only way I can update the references in the text boxes is to select the reference and either right-click and select "update field" or hit F9. Why does this happen, and is there a way to achieve document-wide update of all fields?
You might try converting the Textboxes to FRAMEs. Those will update properly (along with the body of th edocument). You'll find the command in the Format/Textbox/Textbox dialog.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :)
 
J

John Miller

Thanks to Jezebel & Cindy for your responses. Frames won't cut it, since my text boxes are on top of other graphics. Guess I'll take my first shot at creating a macro.

- John
 
C

Charles Kenyon

The following may help:
Private Sub FieldsUpdateAllStory()
' All Story Field Updater
' Written by Charles Kyle Kenyon 9 December 2004
' repaired with help from Jezebel 10 December 2004
' Note, if used in protected form this will reset
' formfields to their defaults
Dim oStory As Range
On Error Resume Next
For Each oStory In ActiveDocument.StoryRanges
Do
oStory.Fields.Update
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next
End Sub

This can be modified to only update a particular type of field as in:

Private Sub RefFieldUpdateAllStory()
' Written by Charles Kyle Kenyon 15 November 2001
' repaired by Jezebel
' All Story Field Updater - Ref fields
Dim oField As Field
Dim oStory As Range
' On Error Resume Next
For Each oStory In ActiveDocument.StoryRanges
' This goes into headers and footers as well as the regular document
Do
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next oStory
End Sub

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


Thanks to Jezebel & Cindy for your responses. Frames won't cut it, since my
text boxes are on top of other graphics. Guess I'll take my first shot at
creating a macro.

- John
 
C

Charles Kenyon

Thank you. I've updated my procedures.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

John Miller

Charles & Jezebel -

Thanks! Given that I've never implemented anything in Visual Basic, this
ought to be an instructive exercise.

I believe it was Socrates who said, "I know I am intelligent, because I know
that I know nothing." If that be true, I think I'm about to find out that
I'm REALLY intelligent...

- John
 
C

Charles Kenyon

http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

http://word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm

http://word.mvps.org/FAQs/MacrosVBA.htm
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Top