Results 1 to 12 of 12
  1. #1
    Lounger
    Join Date
    Sep 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page numbering in merged-type doc needs to restart (2003)

    My question is related to page numbering in a document which is similar to a merged document. I've scanned MVP sites & Microsoft site & haven't yet found a solution. [ome background: My company is converting loan documents to Word and hooking them into our software using XML and XPath. I'm responsible for anything to do with formatting the documents, whether it's with styles, XML, XPath, whatever.]

    Here's the scenario: When there are several applicants on a loan meeting certain criteria, we need to print a document for each of the loan applicants. The way our paradigm currently works, when this happens, a single multi-page Word document will be created So if it's a 4-page document printed for 5 applicants, the data (in the four pages) will be generated 5 times and the resulting file will be 20 pages long. The problem is that page numbering continues throughout the document, rather than appearing as pages 1-4 , five times.

    I've tried:
    - hard coding page numbers. Not good for obvious reasons.
    - using section breaks in various ways w/ page numbering set to restart. One method created a blank page at the end of each document (not good as customers have to pay per page)
    - using a field calculation with PAGEREF pointed to bookmarks. I set a unique bookmark on each of pages 1-4. This should work but doesn't. The pageref should return the page that the bookmark is on, but in the long multi-page document, it might return, for example, the 3rd iteration of page 1, giving me page 9. Also won't work if a doc reflows & numbering changes.

    At this point i'm thinking that the programmers will have to come up with a programming solution. Unless you can help with a Word solution!

    Thanks.

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

    Re: Page numbering in merged-type doc needs to restart (2003)

    Insert a section break at the end of each applicants data (Insert > Break > Section Break > ) you may want to use a Continuous sectiuon break or one that forces a page break, depending on what else you have to cause pagination.

    In each section use Insert > Page Numbers > Format... > Start at 1

    StuartR
    Attached Images Attached Images

  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 numbering in merged-type doc needs to res

    Is it actually merged or "like merged"? I think there must be a way to set your main document's numbering so that when it is merged, it automatically starts each new instance from page 1. My guess would be to set page 1 in your main document to start at 1 rather than to continue from previous, but it's just a guess, as I only do merges a few times per decade.

  4. #4
    Lounger
    Join Date
    Sep 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to restart (2003)

    Thank you, Stuart. I did try using section breaks unsuccessfully, but I couldn't remember what happened, so I just tried again. Here's what happened.

    If I add a continuous section break (page break created by heading 1 style - break before para), the numbering works. However when the document is generated, the continuous break is converted to a next-page section break; and this creates a blank page at the end of each applicant's data. Can't have this.

    If I add a next-page section break, 1) the break is converted to a continuous break in the generated doc 5 times and 2) the next-page break doesn't appear till the last page of the generated doc. For 5 applicants, I end up with 6 sections. The first section in the original template replicates 5 times. The 2nd section (which started out being next-page break) doesn't appear till the last page of the generated doc. All this with resulting page number snafu. (could go into more detail but don't know if you want to hear it all!)

    The original document int his case had 2 pages - 3 with the next-page section break added. It has 2 sections: The main original one, with pages X of {sectionpages}. The 2nd section added for this experiment has the same numbering, set to start again at 1. In the resulting end document, I end up with page 1 of 2, then 2 of 2, then [2 of 3 and 3 of 3 repeated 4 times], then page 1 of 1, which is blank.

    Whew, it's confusing! This is why I gave up using section breaks.

  5. #5
    Lounger
    Join Date
    Sep 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to res

    It's not merged. I described it as "like merged" because it's the easiest way to describe it. Also, I was wondering if there was some merge-related solution to this. The structure of our generated document is so much like a merged document (as far as I can tell). I never use merge unless i select it in the task pane by accident!...

  6. #6
    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 numbering in merged-type doc needs to res

    If there is a blank page, perhaps you have a page break immediately preceding your Next Page Section Break. You don't need that page break. It is best to use Normal view to check on this. If there's no "hard" page break, check your page setup and see whether you can find any odd settings that might force the extra page.

    Actually, how are you generating the document? If you are inserting other documents or AutoText, the breaks might be in there already causing all sorts of confusion...

  7. #7
    Lounger
    Join Date
    Sep 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to res

    We're generating the document with our software (i'm obviously not on the technical team), We're using XML, XPath and XSLT. Thank you for your help, but I think I'm up against some problems that are unique to our situation. I think we need to find a way to programmatically generate separate documents, rather than the way we're doing it.

    For example, a continuous section break a few paragraphs from the end of a document is becoming a next-page section break in the generated doc... Section 2 headers only appear in the last applicant's data (say page 16-20 of the 20-pg generated doc for 5 applicants). Weird stuff.

    Thank you everyone for your suggestions!

  8. #8
    Star Lounger
    Join Date
    Jan 2001
    Location
    Los Angeles
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to res

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    this might be what you are looking for:

    http://mousetrax.com/mastdoc.html

  9. #9
    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 numbering in merged-type doc needs to res

    Why don't you set it up as a merge. It sounds like that would be much easier & that mail merge is designed just for this purpose. You are creating a Form Letter & you could set up which applicants should receive that particular letter. Depending upon the complexity of your criteria, you could even have modified letters going out to different applicants based on the same main document.

    As an aside, I prefer the mail merge helper that was used in Word 2000, rather than the later ones. That can still be used, however. You just have to go to Tools/Customize.../All Commands/ & scroll to Mail Merge Helper. Drag it to a toolbar or menu & use it to start setting up your merges. If you need more information, post back.
    Cheers,

  10. #10
    Lounger
    Join Date
    Sep 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to res

    Thanks Phil. Since i've never used mail merge, I don't know what its capabilities are. Specifically, can it be set up to get/read XML data? (I'm pretty sure our database data is converted to XML.)

  11. #11
    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 numbering in merged-type doc needs to res

    Mail merge uses a variety of different filters to read different file formats. I don't know whether Word 2003 added a filter specific to XML files, or whether one of the database filters would be needed. Given the emphasis on XML in the marketing of Office 2003, one would expect some specific functionality -- unless that functionality is limited to a Microsoft proprietary XML format... Anyway, it is possible to read XML files with VBA and build your own merge engine if all the easy solutions fail. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  12. #12
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Page numbering in merged-type doc needs to restart (2003)

    Just a small point that might not have any bearing - things like section breaks, bookmarks, etc will not stick if they're the last thing in a document; you put them in, save the doc, close and open and they've gone. It sounds like your code is losing the section break you've put in and putting it's own in instead (as opposed to 'replacing' the continuous break with a next page one)?

    When you put the continuous break in, assuming you didn't before, try putting a couple of returns/spaces/whatever after it so it's not the last thing.

    If this isn't applicable, feel free to ignore, but it's the only thing that came to mind for me!

    HTH
    Beryl M


Posting Permissions

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