none
Another newbie question - Is this possible in mail merges - merge field arrays? RRS feed

  • Question

  • Sorry if this is a newbie question but I'm not even sure what terminology to use.

    I'm running VS2008 and Office 2010.  So far my mail merges have been fairly basic.  1. Generate a text (comma deliniated) data file.  2. Set up the doc.  3.  Run the program and create the mail merge.  (All of my merges so far have been controlled by a VB.net Winforms program.)

    What I have here is a basic list.  I need to print out a document that will have a list of indetermanent length, essentially each item a paragraph with it's own set of data.

    Can I do this?  Just how do I do this?  (For that matter what do I call this technique, if it exists?)

    Tuesday, July 19, 2011 2:49 PM

Answers

  • You need Ctrl+F9 for each set of brackets, yes.

    No, there are no unmatched sets. What's throwing you off is the <Enter> part. This is demonstrating how to generate new lines (paragraphs) within the IF that's creating the list.

    I don't know of any clearer examples, although Leigh Webber had a pretty good one, many years ago. But as far as I know, that site isn't up any more.

    Almost as long ago, I wrote a bit on my website on the various possibilities: http://homepage.swissonline.ch/cindymeister/MergFram.htm

    Mostly, I never try to make 1:n lists in mail merge. I find it less hassle to simply program the data merge directly from a data source than to struggle with what the KB article suggests. But in an earlier discussion you said you HAD to use mail merge. That's why I mentioned concatenating the data into a single field in the data source "behind hte scenes"...


    Cindy Meister, VSTO/Word MVP
    Tuesday, July 19, 2011 5:19 PM
    Moderator

All replies

  • This isn't directly supported by Word's mail merge, so it's "work" no matter what approach you take.

    One is described here: 

    http://support.microsoft.com?kbid=211303

     

    Another possibility is to concatenate the list into a single field and drop it into the merge result.


    Cindy Meister, VSTO/Word MVP
    Tuesday, July 19, 2011 4:16 PM
    Moderator
  • I've already looked at that.  So far I just don't understand it and I can't get it to work.  Are there any clearer examples?

     

    (As far as Ctrl-F9 is concerned, do I have to do it for every single pair of brackets shown, or just the outermost one? 

     I've tried copying the code in and I've tried manually typing everything in.   Do I see unmatched brackets in there?)

    Tuesday, July 19, 2011 5:04 PM
  • You need Ctrl+F9 for each set of brackets, yes.

    No, there are no unmatched sets. What's throwing you off is the <Enter> part. This is demonstrating how to generate new lines (paragraphs) within the IF that's creating the list.

    I don't know of any clearer examples, although Leigh Webber had a pretty good one, many years ago. But as far as I know, that site isn't up any more.

    Almost as long ago, I wrote a bit on my website on the various possibilities: http://homepage.swissonline.ch/cindymeister/MergFram.htm

    Mostly, I never try to make 1:n lists in mail merge. I find it less hassle to simply program the data merge directly from a data source than to struggle with what the KB article suggests. But in an earlier discussion you said you HAD to use mail merge. That's why I mentioned concatenating the data into a single field in the data source "behind hte scenes"...


    Cindy Meister, VSTO/Word MVP
    Tuesday, July 19, 2011 5:19 PM
    Moderator
  • Hi Chernick,

    Any update on this problem?


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 25, 2011 12:23 PM
    Moderator