Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert sectionbreak on mailmerge test (97)

    Hello All,

    A user in our firm wants to create the following situation:
    * We have a database with main companies and sub companies information
    * We want to use mailmerge to print information two sided
    * BUT if the main company changes it sould always start printing on a new paper
    (e.g. by changing to a sectionbreak even page)

    Question:
    Is it possible to check if the main company information changes and if so to force Word to print on the next paper?

    Thanks in advance.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: insert sectionbreak on mailmerge test (97)

    In theory what you are proposing should be possible, though Word isn't terribly good at dealing with one-to-many relationships such as your main company with sub companies. It's been some time since I did a merge that was printing two sided (in Access 97), but I believe Word will automatically take care of the section-break even page.

    I would also like to suggest an alternative of using OLE Automation to create the Word document on the fly - I presume your database is Access 97. If not, that wouldn't work however. The advantage of the Automation approach is that you can easily deal with the one-to-many relationship, although it does involve writing some VBA. Hope this helps.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert sectionbreak on mailmerge test (97)

    Hello Wendel,

    Thanks for your reaction.
    The database looks something like this:

    | maincomp | subcomp | Adres | ... |
    | 1 | 1 | ... | ... |
    | 1 | a | ... | ... |
    | 1 | b | ... | ... |
    | 2 | 2 | ... | ... |
    | 2 | a | ... | ... |

    So when printing information as long 'maincomp' is 1 all the information of sub 'a' en 'b' must be printing on two sided pages. If 'maincomp' and 'subcomp' are equal the record should not be printed but the next print MUST be on a new paper.

    I hope this will make any sense.

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: insert sectionbreak on mailmerge test (97)

    I take it from your reply that you are working with a database - is the database Access?
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert sectionbreak on mailmerge test (97)

    sorry Wendell,

    Yes it is Access 97.
    But the table used for the merge is a flat table

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: insert sectionbreak on mailmerge test (97)

    Shucks - I was hoping you really had a main table with a linked table containing the subcompanies. In that case Access could do what you want with relative ease. Doing it in Word is a bit more of a challenge - you basically want to do a catalog style of merge where the entries follow one after another (much like a label merge), but you also want to embed an IF field to check to see whether the current entry has the characteristics of a main company, and if true, insert the sectionbreak even page field. In theory it should work. Good luck.
    Wendell

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

    Re: insert sectionbreak on mailmerge test (97)

    You can probably do this with REF and SET fields. I got the idea from Cindy Meister's tips for mail merge - see the item on avoiding duplicates.

    See the attached document. You can copy the field codes (make them visible with Alt+F9) and paste them into your own document. If you want to create the fields yourself, type Ctrl+F9 to insert a field. Don't type the brackets { } yourself.

    It should look like this (with field codes displayed):
    { IF { REF PreviousComp } <> {MERGEFIELD MainComp } "===Section Break (Odd Page)====
    " "" } { MERGEFIELD MainComp } {MERGEFIELD SubComp} ... { SET PreviousComp { MERGEFIELD MainComp } }

    The idea is that the previous MainComp is stored by the SET field, and compared to the current MainComp in the IF field. If they are different, a section break (I think it should be an odd page break) is inserted, otherwise an empty string.
    Attached Files Attached Files

  8. #8
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert sectionbreak on mailmerge test (97)

    Thanks Hans,

    I'm not sure if the section break will work this way...
    but I'll give it to our programmer.

Posting Permissions

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