Tony
Sun Dec 09 13:35:57 PST 2007
Hi zkid,
Have you tried this? It's not an error; you can't trap it.
The message can be suppressed with DisplayAlerts None but the question was
"Why", not "How do I get round it?" - and, yes, Word does have some unruly
children and that may be the only answer.
--
Enjoy,
Tony
"zkid" <zkid@discussions.microsoft.com> wrote in message
news:C487B629-FE1A-4F40-B213-6AF1AAA534A4@microsoft.com...
> Forgive my ignorance, but is it such a bad thing to just go ahead and
> update
> all of the fields in the doc? I just plug in the code for doing a print
> preview, and that has never given me any grief.
>
> Also, I note that you have two Error capturing statements. I'm wondering
> if
> trapping the actual error by number might be an option. That way, you can
> clear it completely and Word's stack won't get so cluttered.
>
> Otherwise, from what Tony says, it looks like footnotes are unruly
> children.
>
> "Greg Maxey" wrote:
>
>> No it doesn't occur with Print, PrintPreview or by updating the
>> individual
>> field. The prompt appears with Ctrl+a and F9 or when updating document
>> fields with VBA if the footer contains a REF field.
>>
>> Sub myUpdateFields()
>> Dim rngStory As Word.Range
>> Dim oShp As Word.Shape
>> For Each rngStory In ActiveDocument.StoryRanges
>> Do
>> On Error Resume Next
>> rngStory.Fields.Update
>> Select Case rngStory.StoryType
>> Case 6, 7, 8, 9, 10, 11
>> If rngStory.ShapeRange.Count > 0 Then
>> For Each oShp In rngStory.ShapeRange
>> If oShp.TextFrame.HasText Then
>> oShp.TextFrame.TextRange.Fields.Update
>> End If
>> Next oShp
>> End If
>> Case Else
>> 'Do Nothing
>> End Select
>> On Error GoTo 0
>> 'Get next linked story (if any)
>> Set rngStory = rngStory.NextStoryRange
>> Loop Until rngStory Is Nothing
>> Next rngStory
>> End Sub
>>
>>
>> --
>> Greg Maxey/Word MVP
>> See:
>>
http://gregmaxey.mvps.org/word_tips.htm
>> For some helpful tips using Word.
>>
>>
>> zkid wrote:
>> > Hmmm. Okay, instead of selecting the footnote storyrange, try doing
>> > a print preview manually. Do you still get the funky message? Print
>> > preview should update all field codes in the doc without the need to
>> > select anything.
>> >
>> > "Greg Maxey" wrote:
>> >
>> >> zkid,
>> >>
>> >> It doesn't seem to matter. Old normal.dot, new normal.dot, any of a
>> >> dozen custom templates that I routinely use, with or without
>> >> Add-Ins. If I insert a REF field in the footnote storyrange, CTRL+a
>> >> to select all, and click F9 that dialog appears.
>> >>
>> >>
>> >>
>> >> --
>> >> Greg Maxey/Word MVP
>> >> See:
>> >>
http://gregmaxey.mvps.org/word_tips.htm
>> >> For some helpful tips using Word.
>> >>
>> >>
>> >> zkid wrote:
>> >>> Okay. Please humor me and rename normal.dot to Old normal.dot.
>> >>> Then open Word and try your template again.
>> >>>
>> >>> I've seen your name around, so I'm assuming you know where the
>> >>> normal template is located. For anyone else reading this:
>> >>>
>> >>> C:\Documents and Settings\[your username]\Application
>> >>> Data\Microsoft\Templates
>> >>>
>> >>> If that doesn't do the trick, then try deselecting your add-ins. If
>> >>> it
>> >>> still is a problem, then most likely there is some corruption in the
>> >>> templates themselves.
>> >>>
>> >>> "Greg Maxey" wrote:
>> >>>
>> >>>> I may be behind the times, but I only have one computer. It
>> >>>> happens in Word2003 with normal.dot and in Word2007 with
>> >>>> normal.dotm. It also happens with document created using other
>> >>>> templates.
>> >>>>
>> >>>> --
>> >>>> Greg Maxey/Word MVP
>> >>>> See:
>> >>>>
http://gregmaxey.mvps.org/word_tips.htm
>> >>>> For some helpful tips using Word.
>> >>>>
>> >>>>
>> >>>> zkid wrote:
>> >>>>> Are you having the same problem on a different computer? If not,
>> >>>>> then your normal template is corrupt and needs to be deleted.
>> >>>>>
>> >>>>> "Greg Maxey" wrote:
>> >>>>>
>> >>>>>> This happens with a new blank document containing only one REF
>> >>>>>> field in a single footnote.
>> >>>>>>
>> >>>>>> --
>> >>>>>> Greg Maxey/Word MVP
>> >>>>>> See:
>> >>>>>>
http://gregmaxey.mvps.org/word_tips.htm
>> >>>>>> For some helpful tips using Word.
>> >>>>>>
>> >>>>>>
>> >>>>>> zkid wrote:
>> >>>>>>> I've seen this message under two circumstances:
>> >>>>>>>
>> >>>>>>> 1. The document in question has a bit of corruption; and/or
>> >>>>>>> 2. There are a plethora of field codes, cross-references, table
>> >>>>>>> of contents hyperlinks, etc.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> "Greg Maxey" wrote:
>> >>>>>>>
>> >>>>>>>> In both Word 2003 and 2007 if I have a REF field in a footnote,
>> >>>>>>>> select the footnote range and press F9 Word throws up a
>> >>>>>>>> notification that it can not undo this action and asked if I
>> >>>>>>>> want to continue.
>> >>>>>>>>
>> >>>>>>>> After clicking yes the field updates but I can undo it with
>> >>>>>>>> Ctrl z without a problem.
>> >>>>>>>>
>> >>>>>>>> Anyone know why this prompt appears?
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> --
>> >>>>>>>> Greg Maxey/Word MVP
>> >>>>>>>> See:
>> >>>>>>>>
http://gregmaxey.mvps.org/word_tips.htm
>> >>>>>>>> For some helpful tips using Word.
>>
>>
>>