Results 1 to 13 of 13
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page Numbering ??? (2003 xp2)

    Greetings,
    I have not posted for a while, but I am now in need of help.

    I have attached a document (zipped). The issue is that when a page is added or deleted, the total page count does not change on page 1.

    The First page is not using headers. The Field has been placed into a cell.
    There are different sections to the document.
    Pages 2 thru x get handled correctly for total page counts.

    This document is password protected. For sake of your assistance, it is "1"
    There are macros, when the first two boxes appear, just click no. at the third box click Ok.

    The document is setup to be a Form.

    Hopefully, I have not left anything out.

    Thanks,
    Brad
    Attached Files Attached Files

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Page Numbering ??? (2003 xp2)

    To make sure I'm looking at this right, when I look at the bottom right corner you have "SH #" to designate that page's number and "OF #" to designate the total number of pages in the document. The SH, OF and their page number fields appear in the body of the first page but in the footer area of subsequent pages. I'm also viewing this with Word 2000, but I don't think that should make a difference.

    When I first opened it, the first page showed "SH 1" and "OF 1" even though the doc has three pages altogether. So my first step was to change the Tools/Options/View to include Field Codes so I could see how the fields were coded. When I did that I could see that the first page's OF number field was different from the field code used in page two and three's footer. It was a FORMFIELD set to Regular Type, with a maximum length of 2 digits, and Fill-in Enabled. Once I saw that, I went into the footer of page two, made a copy of the OF field to the clipboard, went back to page one and replaced the FORMFIELD with the field from the 2nd page footer. Did I lose you yet? Once I did that, I went in and turned off the Field Codes from the view. Now on page one it shows "OF 3". That's an improvement. Next, I went to the end of the doc and stuck in a page break to create a fourth page. By design, the footer field codes will refresh automatically. But the first page OF field will not automatically refresh until you save, print or change the page view. That's also by design. You can also force the refresh of a field code by right clicking on the field code and choosing Update Field. I hope this helps.
    Daisy

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    Daisy,
    I follow what you say. Thanks. I do have a question. Is it possible to have a macro that automatically checks for page changes, and then refreshs before saving or printing? Trying to make this as painless as possible for my users.

    Thanks,
    Brad

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Page Numbering ??? (2003 xp2)

    When I added the fourth page, the first page still showed OF 3 but soon as I sent it to print it changed it to OF 4 and it showed OF 4 on the printed copy. The act of printing or saving will automatically update the number. I would image you could write a macro to do the Update Field process before the page is saved or printed but I don't think you can get it to automatically run when there's a change. I'm pretty sure it would require some interaction which I think would defeat the purpose. I think Word's default to automatically update the OF # at the time the page is saved or printed would be enough.
    Daisy

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    Ok,

    Thanks for the time and help,

    Brad

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

    Re: Page Numbering ??? (2003 xp2)

    Have a look at Tools > Options > Print and make sure that the checkbox marked "Update Fields" has been checked.

    StuartR

  7. #7
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    All,
    I did the below, "Tools > Options > Print" and that helps for part of the issue. However I am dealing with folks that if they do not see the "updates" they think something is wrong. I have also done the following. 1) created a toolbar, added a link in the toolbar (button) to run a quick macro for doing a print preview and closing the pring preview for them to refresh the page count on page 1. However the commands are not working for versions prior to Word 2003. Is there a way to modify the macro to to check for prior versions and run the correct sub of a macro? I think going back to Word 2000 is enough.


    Current Sub


    Sub Fixpagecount()
    '
    ' Fixpagecount Macro
    '
    '
    ActiveDocument.PrintPreview
    ActiveDocument.ClosePrintPreview
    End Sub


    thanks,
    Brad

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Page Numbering ??? (2003 xp2)

    What exactly is the problem? PrintPreview and ClosePrintPreview should work in all versions of Word starting with Word 97.

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

    Re: Page Numbering ??? (2003 xp2)

    If you're going to write a Macro anyway, then try something like this...

    StuartR

    <code>
    Public Sub UpdateHeadersAndFooterFields()

    Dim sec As Section
    Dim hdrftr As HeaderFooter
    Dim shp As Shape
    StatusBar = "Updating Headers and Footers throughout document..."

    For Each sec In ActiveDocument.Sections
    For Each hdrftr In sec.Headers
    If Not hdrftr.LinkToPrevious Then
    hdrftr.Range.Fields.Update
    If hdrftr.Shapes.Count > 0 Then
    For Each shp In hdrftr.Shapes
    If shp.TextFrame.HasText Then _
    shp.TextFrame.TextRange.Fields.Update
    Next shp
    End If
    End If
    Next hdrftr
    For Each hdrftr In sec.Footers
    If Not hdrftr.LinkToPrevious Then
    hdrftr.Range.Fields.Update
    If hdrftr.Shapes.Count > 0 Then
    For Each shp In hdrftr.Shapes
    If shp.TextFrame.HasText Then _
    shp.TextFrame.TextRange.Fields.Update
    Next shp
    End If
    End If
    Next hdrftr
    Next sec
    StatusBar = ""
    End Sub
    </code>

  10. #10
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    Greetings.

    The way the file is setup, the first page is not using a footer section. The rest of the pages do, and the updates work correctly.

    Just the first page does not.

    Brad

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

    Re: Page Numbering ??? (2003 xp2)

    Hi Brad,

    I think you're making this harder than it needs to be. You can put the page numbering for the first page into the footer and still have it appear within the table. This way, the page numbering on the first page will update automatically, without the need for macros, print preview, etc.

    The method involves putting a borderless 'floating' text box into the first page footer, and putting the page numbering in that. I went to the extent of putting the numbers in a two-row borderless table within the text box. Then it was a simple matter of aligning the text box with your form.

    See attached.
    Attached Files Attached Files
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  12. #12
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    Thanks,
    Will take a look and let you know....

    Brad

  13. #13
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page Numbering ??? (2003 xp2)

    This solution did the trick....

    Thanks much.
    Brad

Posting Permissions

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