Results 1 to 13 of 13
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page field update (xp sp2)

    hi all,

    it's time to ask my first question.
    i've got the following field in my footer:

    {IF {PAGE}=

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    Hi Pieter:
    I can't check since I have Word 2000 and I don't have an explanation as to why the field doesn't update on printing, but does on Print Preview. Do you have any add-ins that intercept the Print command? If you start Word from the command line, "winword.exe /a", does it work correctly?

    Incidentally, I think there's something wrong with the syntax, as posted. The quotes seem to be spaced wrong. It doesn't print on the second page, only the first. Could you try:

    { IF { Numpages } > 1 "{ page }/{ numpages }" "" }

    or am I missing your intention?
    Cheers,

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: page field update (xp sp2)

    Remember that weird exploit that could import a document into a INCLUDETEXT field inside an IF field that rendered the process invisible? I wonder if Microsoft's patch for that somehow messed up the recalculation inside your field? If you Shift+F9 on the outer field and update the inner IF field, does it give the correct result? Do you have to drill down further inside?

    Just a stray thought... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    thanks Phil & Jefferson,

    my explanation of the field logic was not complete & i should've used Jefferson's utilty to paste the field code correctly to the lounge without syntax errors - so here goes:
    {IF { PAGE } = 1 "{ IF { NUMPAGES } > 1 "{ PAGE }/{ NUMPAGES }." ""}"}

    the field in itself works correctly, it only prints pages/numpages in the footer of the first page only, if there is more than 1 page. on subsequent pages, the page/numpages result is displayed in the header instead with another field, which does update correctly - but it only checks the page field and not the numpages field.
    if i run without add-ins, i still experience the same problem - the field will not update if the second page gets deleted
    the patch for the includetext field exploit has not been installed, it is a plain sp2.

    so it looks like microsoft's claim that the numpages field updating issue has definitively been resolved since word 97 "sr3" (the y2k update), is false.
    if you want to have a look at an example document i can send it offline.

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: page field update (xp sp2)

    Hi Pieter,

    I'm running Word 2K, with only SR1 at the moment, and both your field and Jefferson's works fine. They do different things though:
    . Yours puts the 1st page # and numpages on the first page only, but only if there is more than one page
    . Jefferson's puts the 1st page # and numpages on all pages, but only if there is more than one page
    In both cases, numpages updates as pages are added/deleted, and both fields disappear if all except the 1st page is deleted.

    Cheers
    PS: In your field's case, {PAGE}/{NUMPAGES} could be reduced to 1/{NUMPAGES}, since the output only ever appears on page #1.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    Hi Pieter:
    I tried your field in Word 2000 SR-3. It works as it should. We need someone who has Word 2002 to test it to see if it's something on your machine or a bug. It wouldn't be the first time that something was fixed in an earlier version & reappeared in a later version.

    Maybe it's just the document. I'd be happy to look at it if you'd like to send it offline.
    Cheers,

  7. #7
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    thanks macropod and Phil,

    macropod you're right, as this field will only be displayed on the first page, i can reduce it to 1/{ numpages }
    i'm actually glad this glitch cannot be reproduced on other versions of word, so it seems only 2k2sp2 could be affected in theory (for completeness, it is a dutch version build 10.0.4219), lest the document has corrupted. in that case i've got some work to do, because it served as a base template with which i created around 120 other templates which exhibit the same problem.
    Phil, sending you the document offline.

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: page field update (xp sp2)

    I have just tested
    {IF { PAGE } = 1 "{ IF { NUMPAGES } > 1 "{ PAGE }/{ NUMPAGES }." ""}"}
    in the page footer on Word 2002 SP2 and it works in the way I would expect. If there is more than 1 page then it displays Page 1/x on the first page. If I delete text to reduce to one page and update fields then it clears again.

    StuartR

  9. #9
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    hi Stuart,


    thanks for testing with word 2002 sp2.
    i've also retested and did the following.
    i created a second page and the fields update automatically without any intervention to display 1/2 on the first, and 2/2 on the second.
    i created a third page and fields update automatically without any intervention to display 1/3, 2/3 and 3/3.
    now for something intresting : if i delete the third page, the fields update automatically without intervention to display 1/2 and 2/2. this is what i understand is normal and standard behavior of word.
    if i now delete the second page, the field will not update and keeps displaying 1/2, although there no longer is a second page. if i then print, the result 1/2 will be printed. i have to go into printpreview, or go into the footer to update the field, only then the field result will be adjusted to display an empty result. this is _an error_, either the document became corrupted somehow, or this version of word reintroduced the long standing numpages update bug that has only been solved since word 97 sr3.

  10. #10
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    Hi Pieter:
    I received your document & tested it in Word 2000. I could find no problem. The field updated the way it should. I noticed one thing only & found that it ocurred in newly created documents with similar fields also. If I added a page, the field updated immediately, whether I added one or two pages. If I deleted a page AND had the page one footer in view at the same time, the field display didn't update. However, if I scrolled so the footer was out of view & then back into view, the footer field was updated. I concluded that this was a screen redraw issue & not a Word problem.

    I found that printing the document also refreshed the field. This is one of those fields that should update in the header/footer regardless of whether Tools/Options/Print/Update fields is checked or not. And it shouldn't matter if Tools/Options/General/Background repagination is checked. Perhaps if you post the document here (after removing anything confidential), Stuart or one of the others who have Word 2002 could test it.

    Out of curiosity, along the lines of Jefferson's thoughts, what is your registry setting for

    HKEY_CURRENT_USERSoftwareMicrosoftOffice10.0WordOp tionsFieldCalcSecurityLevel

    Does changing it to 0 make any difference? (Don't forget to set it back, if you want).

    I know you're away from the Lounge today, so I'll send this message to you offline also.

  11. #11
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    hi Phil,

    thanks so much for having a look.
    i'll guess i have to live with it. it is not too big a problem since it will only occur when a document is reduced from 2 pages to 1 page, either through reformatting or after correcting an error. this will only rarely happen.
    i've checked and rechecked, printing does not refresh the field, printpreview does.
    i've also verified again that the field patch has not been installed and therefore there is no FieldCalcSecurityLevel registry key.

  12. #12
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page field update (xp sp2)

    i'll include an empty document that only contains the field with the described behavior, Stuart or anyone with word 2002 could you test it?
    Attached Files Attached Files

  13. #13
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: page field update (xp sp2)

    Strange.

    If I add and then delete a second page then the field does not clear until I double click the footer to edit it, at which point it updates correctly.
    I have Tools > Options > Print set to Update Fields, but the single page document still printed with 1/2 at the bottom.

    When it is in this state (single page showing 1/2) I can issue the VBE immediate command
    ActiveDocument.Sections(1).Footers(1).Fields.Updat e
    followed by
    ? ActiveDocument.Sections(1).Footers(1).Range.Text
    And it shows 1/2

    If I then double click on the footer to open it then it starts behaving correctly.

    StuartR

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •