Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I didn't think would be non-standard, but it apparently is...

    I want to mail merge w/Word to a 1 page doc that is a PO/Sales Order. It has a "Detail" section in the middle with line items. I got the data this way by creating a "view" in MSSQL 2005, and it imports fine to the MS Word doc.

    The problem comes in trying to make the detail for each PO print on that page, then move onto the next. So imagine data like:

    [...] order part [...]
    1 widget 5000
    1 widget bearing grease
    2 widget 3000
    2 widget wrench (metric)


    You get the idea...

    So in this cheesy example, I have 2 orders, which I want to create post-merge 2 pages. Each page of each PO will create 2 lines in the "detail", or "itemization" section of the master/template document.

    So I have all my rows sorted by key (in this example, the key is the "order" column.

    Isn't there a simple way to do this in MS Word 2003?

    TIA!

    pat

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome to the Lounge!

    It's not exactly simple, but it can be done. Our moderator and Word MVP macropod has written a tutorial accompanied by sample files about this type of mail merge: Word 97-2007 Mailmerge Tutorial: Create Sorted Listings (v1.52). Download the zip file and read the tutorial first.

  3. #3
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='794329' date='21-Sep-2009 16:13']Welcome to the Lounge!

    It's not exactly simple, but it can be done. Our moderator and Word MVP macropod has written a tutorial accompanied by sample files about this type of mail merge: Word 97-2007 Mailmerge Tutorial: Create Sorted Listings (v1.52). Download the zip file and read the tutorial first.[/quote]
    HansV,

    Thanks for writing. I saw that tutorial before I posted, and I noticed that it inserted page breaks based on the repeating/detail fields. This is fine for a doc where the repeating data is last on the template (detail in POs are in the middle) and creating these page breaks doesn't interfere with the normal page breaks.

    I didn't think it applied for a doc with detail/itemization in the middle of the document. The example didn't incorporate these groups being pre-ceded and post-ceded by static/repeated data after the "groups".

    Is confidence high that such an application is applicable?

    TIA!

    pat

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The method macropod describes uses a mailmerge of type "directory". In such a mail merge, you only get page breaks if you insert them into the document with the merge fields yourself; if you don't, the resulting merged document will have no page breaks at all.

    The sections "Inserting Text Before the Repeated Data" and "Inserting Text After the Repeated Data" in the tutorial describe how to surround the grouped detail data by other text.

  5. #5
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='794340' date='21-Sep-2009 17:01']The method macropod describes uses a mailmerge of type "directory". In such a mail merge, you only get page breaks if you insert them into the document with the merge fields yourself; if you don't, the resulting merged document will have no page breaks at all.

    The sections "Inserting Text Before the Repeated Data" and "Inserting Text After the Repeated Data" in the tutorial describe how to surround the grouped detail data by other text.[/quote]
    HansV,

    Thanks again for writing. I looked over the code, and if I understand you, I can use variables and conditional logic to insert a page break later in the data, say after the repeating data, right? I thought that you had to make your page break at the end of the last row of the repeating data, and were forced to have that repeating data at the bottom of each page.

    Naturally, a PO/Invoice/Order would have all that in the middle of the document. I'll give it a try.

    Thanks!

    pat
    :)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can insert a page break at any place in the document with the merge fields, wrapped in an IF field if you want to break a page only if the order changes. Macropod's tutorial also has an example of that.

Posting Permissions

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