View Single Post
  #9   Report Post  
Posted to microsoft.public.word.pagelayout
Charles Kenyon
 
Posts: n/a
Default Fields in Text Boxes Don't Update

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

http://word.mvps.org/FAQs/MacrosVBA/...csIn15Mins.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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.

"John Miller" wrote in message
...
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

"Charles Kenyon" wrote in
message ...
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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.


"John Miller" wrote in message
...
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