Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Aug 2013
    Thanked 0 Times in 0 Posts

    Mail Merge: Juggling fields by combining bookmarks?

    I'm doing a "directory" or "catalog" mail merge based on an Excel sheet in a typical format:

    No code has to be inserted here.

    The problem is that in my Word document I have to group the first two fields of several rows (usually two), followed by the last two fields of those rows. So the output will look something like this:

    A1, B1, A2, B2
    -- C1, C2
    -- D1, D2

    A3, B4, A3, B4
    -- C3, C4
    -- D3, D4

    My first thought would to use a Set field to keep a running collection of the records in the C field, and another for the D's. That is, each record would have something like:
    { SET CombinedC {CombinedC} & {Field C} }
    { SET CombinedD {CombinedD} & {Field D} }

    So after merging the first two records, {CombinedC} would equal "C1 & C2" and {CombinedD} would be "D1 & D2". I'd insert them at the correct point in the doc.

    But the SET command doesn't seem to do what I want: append "Field C" to "CombinedC". Am I doing it wrong, or is it not possible? Is there another way to concatenate fields from multiple records?


  2. #2
    New Lounger
    Join Date
    Aug 2013
    Thanked 0 Times in 0 Posts
    Maybe this will work.

    At the end of the odd number rows, I'll say:
    {SET PrevA <<Field A>>}
    {SET PrevB <<Field B>>}
    {SET PrevC <<Field C>>}
    {SET PrevD <<Field D>>}
    ...but don't actually display anything.

    On the even number rows I show:
    <<PrevA>>,<<PrevB>>,<<Field A>>,<<Field B>>,[linefeed]
    -- <<PrevC>>,<<Field C>> [linefeed]
    -- <<PrevD>>,<<Field D>>

    However, this only works if all the rows are in groups of two. Also, there may be blank lines where the odd rows would be displayed, but I can handle that.

  3. #3
    Super Moderator
    Join Date
    May 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 406 Times in 335 Posts
    Hi Shawn,

    Word's mailmerge tools really aren't designed for this. A variation on the fields in my Microsoft Word Catalogue/Directory Mailmerge Tutorial ( might work for a simple text string or for adding numbers together, but that's about the limit of what's possible. You might do better to use a macro to run your entire process and not bother with mailmerge at all.

    Paul Edstein
    [MS MVP - Word]

Tags for this Thread

Posting Permissions

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