Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Word Notification on Update Fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Maxey - 05 Dec 2007 14:38 GMT
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?

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

zkid - 07 Dec 2007 01:36 GMT
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.

> 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
[quoted text clipped - 4 lines]
>
> Anyone know why this prompt appears?
Greg Maxey - 07 Dec 2007 02:32 GMT
This happens with a new blank document containing only one REF field in a
single footnote.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I've seen this message under two circumstances:
>
[quoted text clipped - 16 lines]
>> http://gregmaxey.mvps.org/word_tips.htm
>> For some helpful tips using Word.
zkid - 07 Dec 2007 02:41 GMT
Are you having the same problem on a different computer?  If not, then your
normal template is corrupt and needs to be deleted.

> This happens with a new blank document containing only one REF field in a
> single footnote.
[quoted text clipped - 19 lines]
> >> http://gregmaxey.mvps.org/word_tips.htm
> >> For some helpful tips using Word.
Greg Maxey - 07 Dec 2007 03:30 GMT
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.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Are you having the same problem on a different computer?  If not,
> then your normal template is corrupt and needs to be deleted.
[quoted text clipped - 29 lines]
>>>> http://gregmaxey.mvps.org/word_tips.htm
>>>> For some helpful tips using Word.
zkid - 07 Dec 2007 17:42 GMT
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.

> 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
[quoted text clipped - 33 lines]
> >>>> http://gregmaxey.mvps.org/word_tips.htm
> >>>> For some helpful tips using Word.
Greg Maxey - 08 Dec 2007 02:16 GMT
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.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Okay.  Please humor me and rename normal.dot to Old normal.dot.  Then
> open Word and try your template again.
[quoted text clipped - 53 lines]
>>>>>> http://gregmaxey.mvps.org/word_tips.htm
>>>>>> For some helpful tips using Word.
zkid - 08 Dec 2007 03:23 GMT
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.

> zkid,
>
[quoted text clipped - 60 lines]
> >>>>>> http://gregmaxey.mvps.org/word_tips.htm
> >>>>>> For some helpful tips using Word.
Greg Maxey - 08 Dec 2007 04:04 GMT
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

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Hmmm.  Okay, instead of selecting the footnote storyrange, try doing
> a print preview manually.  Do you still get the funky message?  Print
[quoted text clipped - 72 lines]
>>>>>>>> http://gregmaxey.mvps.org/word_tips.htm
>>>>>>>> For some helpful tips using Word.
zkid - 09 Dec 2007 21:20 GMT
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.

> 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
[quoted text clipped - 102 lines]
> >>>>>>>> http://gregmaxey.mvps.org/word_tips.htm
> >>>>>>>> For some helpful tips using Word.
Tony Jollans - 09 Dec 2007 21:35 GMT
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.

Signature

Enjoy,
Tony

> Forgive my ignorance, but is it such a bad thing to just go ahead and
> update
[quoted text clipped - 116 lines]
>> >>>>>>>> http://gregmaxey.mvps.org/word_tips.htm
>> >>>>>>>> For some helpful tips using Word.
Greg Maxey - 10 Dec 2007 01:30 GMT
zkid,

There is nothing at all wrong to update all of the fields in a document.
That is exactly what I was doing when I first encountered this issue.  I was
using the code shown below to
to update all the fields in a document as part after certain bookmarks where
defined in a Userform.  I had never had a REF field in a footnote before and
was surprised by the alert that popped up.

I admit that PrintPreview and ClosePrintPreview is a quick and, as far as I
know, efficient way to update fields. I just don't normally use it because
sometimes there are other things that I might want to do with fields.

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

As Tony mentions, this post wasn't to find out how to stop the alert from
appearing but a question as to why it appears.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> 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
[quoted text clipped - 121 lines]
>>>>>>>>>> http://gregmaxey.mvps.org/word_tips.htm
>>>>>>>>>> For some helpful tips using Word.
Tony Jollans - 07 Dec 2007 10:37 GMT
I just got this - once - but I *could* undo it despite the message and after
that I haven't been able to reproduce it. (2007)

Signature

Enjoy,
Tony

> 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
[quoted text clipped - 4 lines]
>
> Anyone know why this prompt appears?
Tony Jollans - 07 Dec 2007 10:42 GMT
Actually I can reproduce it but can't quite see the circumstances that cause
it. However I can always undo it - and, no, I haven't a clue why it appears
:(

Signature

Enjoy,
Tony

>I just got this - once - but I *could* undo it despite the message and
>after that I haven't been able to reproduce it. (2007)
[quoted text clipped - 7 lines]
>>
>> Anyone know why this prompt appears?
Tony Jollans - 08 Dec 2007 14:52 GMT
I see from other posts that it can happen in a few situations but for me
with footnotes it seems to be consistent - updating fields in the whole
story triggers that message. A sample bit of code just for fun ...

   With Documents.Add
       With .Footnotes.Add(Range:=.Range, Reference:="")
           .Range.Fields.Add Range:=.Range, Text:="Ref Test"
           .Range.Document.StoryRanges(.Range.StoryType).Fields.Update
           ' Above triggers false message
       End With
       ' Tidy up and prove the message wrong
       Do While Not .Saved
           .Undo
       Loop
       .Close
   End With

Signature

Enjoy,
Tony

> Actually I can reproduce it but can't quite see the circumstances that
> cause it. However I can always undo it - and, no, I haven't a clue why it
[quoted text clipped - 11 lines]
>>>
>>> Anyone know why this prompt appears?
Greg Maxey - 08 Dec 2007 15:48 GMT
Tony,

Yes.  I first came across it the other day running this code.  I am sure
that that was the first time I have ever seen it and the first time I had
ever had a REF field in a footnote.

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

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I see from other posts that it can happen in a few situations but for
> me with footnotes it seems to be consistent - updating fields in the
[quoted text clipped - 42 lines]
>>>> http://gregmaxey.mvps.org/word_tips.htm
>>>> For some helpful tips using Word.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.