• page field update (xp sp2)

    Author
    Topic
    #393395

    hi all,

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

    {IF {PAGE}=

    Viewing 3 reply threads
    Author
    Replies
    • #712965

      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,

    • #712966

      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,

    • #712998

      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… smile

      • #713223

        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.

        • #713715

          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
          [Fmr MS MVP - Word]

          • #713739

            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.

            • #713741

              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

            • #713753

              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.

            • #713888

              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.0WordOptionsFieldCalcSecurityLevel

              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.

            • #714782

              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.

            • #714784

              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?

            • #714792

              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.Update
              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

            • #714793

              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.Update
              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

            • #714785

              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?

            • #714783

              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.

            • #713889

              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.0WordOptionsFieldCalcSecurityLevel

              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.

            • #713754

              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.

            • #713742

              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

          • #713740

            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.

        • #713716

          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
          [Fmr MS MVP - Word]

        • #713723

          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,

        • #713724

          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,

      • #713224

        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.

    • #712999

      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… smile

    Viewing 3 reply threads
    Reply To: page field update (xp sp2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: