View Single Post
  #10  
Old July 2nd, 2004, 02:44 PM
Greg Maxey
external usenet poster
 
Posts: n/a
Default ASK Field Behavior

Macropod,

You sure do know your field business. Thanks for the tip.

I was completely dumbfounded as to why I was seeing such odd behavior with
both Word2000 and Word2003 after Peter and Graham replied. I started
digging and realized that a year or so ago I substituted the following macro
for Word's built-in UpdateFields command on both my office and home
computer.

Sub UpdateFields()

'Updates All Fields in Active Document Created by Graham Mayor

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

I removed the macro and restored the original UpdateFields command to the F9
function and things straightened out :-). Oddly enoungh I went back and
restored the macro to the F9 function and things are still working normally.
I don't understand what happened, but it appears to be normal now.

Thanks again.
--
Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in

macropod wrote:
Hi Graham et al,

You can solve the problem of the REF field in the header not
displaying by wrapping both fields with a QUOTE field, as in:
{QUOTE{ASK Age "How old are you?"}{Age}}

To suppress the 'Error! Bookmark not defined.' message before the ASK
has been answered, simply put an empty 'Age' bookmark immediately
before the field.

Cheers

"Graham Mayor" wrote in message
...
Having re-read Greg's first message, I have to say I don't get the
problem with the second REF field, only the reluctance of the first
one to update.

--

Graham Mayor - Word MVP

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




Peter Jamieson wrote:
Graham Mayor wrote:

FWIW I experience the same 'problem' here with Word 2003.
Update of fields in headers has always been a bit hit and miss. The
only way I was able to get this to display correctly was to modify
my update macro to use two techniques - the first to update the
fields and the second to switch print preview which forces the
first field to display correctly without forcing the prompt on the
ask
field for a second time.

Sub UpdateAll()
Dim oStory As Range
Dim oField As Field
For Each oStory In ActiveDocument.StoryRanges
For Each oField In oStory.Fields
oField.Update
Next oField
Next oStory
Options.UpdateFieldsAtPrint = True
Application.ScreenUpdating = False
PrintPreview = True
PrintPreview = False
ActiveDocument.ActiveWindow.View.Type = wdPrintView
Application.ScreenUpdating = True
End Sub

Curious, isn't it? I have no problem either on Word 2000 or Word
2003, either using manual updates or the for next loop with no
additional code. But I am using a very simple example.

Peter Jamieson





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004