Word Mail Merge and Word Tables.

V

vaitrafra

Hi all,
I searched the web but it seems i can't find my answer.

I'm trying to populate a table via mail merge.

It's the common situation of a commercial quote where in the first MM record
you wnat to print the headline with addresses etc. and from the second record
to the end you have to print out a product table with descriptions and prices.
I cant find a way to tell to MM to populate the table consequentially,
without creating an entire new table for each record but advancing to a new
row at every one (like pressing tab in the last cell of the row).

Thanks.

P.S. I know that's the worst english ever, but i'm italian, cant help it.
 
M

macropod

See: http://support.microsoft.com/?kbid=211303
Note that the field code construction in that article results in an extra line being inserted between records if the data source is
an Excel workbook.

The following (simpler) field coding eliminates the unwanted extra lines from the first example:
{QUOTE{IF{MERGESEQ}= 1 {SET Place ""}}"{IF{MERGEFIELD City}<> {Place} "{IF{MERGESEQ}= 1 "" "<ENTER>
"}{MERGEFIELD City}{SET Place {MERGEFIELD City}}<ENTER>
<ENTER>
"}{MERGEFIELD Employee}<TAB>{MERGEFIELD Sales}<ENTER>
"}<ENTER>

For the second example, the field code becomes:
{QUOTE{IF{MERGESEQ}= 1 {SET Place ""}}"{IF{MERGEFIELD City}<> {Place} "{IF{MERGESEQ}= 1 "" {QUOTE 12}}{MERGEFIELD City}{SET Place
{MERGEFIELD City}}<ENTER>
<ENTER>
"}{MERGEFIELD Employee}<TAB>{MERGEFIELD Sales}<ENTER>
"}<ENTER>
or
{QUOTE{IF{MERGESEQ}= 1 {SET Place ""}}"{IF{MERGEFIELD City}<> {Place} "{IF{MERGESEQ}= 1 "" "
----------------------------Page Break--------------------------------
"}{MERGEFIELD City}{SET Place {MERGEFIELD City}}<ENTER>
<ENTER>
"}{MERGEFIELD Employee}<TAB>{MERGEFIELD Sales}<ENTER>
"}<ENTER>

For the third example, the field code becomes:
{QUOTE{IF{MERGESEQ}= 1 {SET Place ""}}"{IF{MERGEFIELD City}<> {Place} "{IF{MERGESEQ}= 1 "" "<ENTER>
"}{MERGEFIELD City \* Upper}{SET Place {MERGEFIELD City}}<ENTER>
<ENTER>
"}{MERGEFIELD Employee}<TAB>{MERGEFIELD Sales}<ENTER>
"}<ENTER>

For the fourth example, the field code becomes:
{QUOTE{IF{MERGESEQ}= 1 {SET Place ""}}"{IF{MERGEFIELD City}<> {Place} "{IF{MERGESEQ}= 1 "" "<ENTER>
"}These are the records for {MERGEFIELD City \* Upper}{SET Place {MERGEFIELD City}}<ENTER>
<ENTER>
"}{MERGEFIELD Employee}<TAB>{MERGEFIELD Sales}<ENTER>
"}<ENTER>
 
M

macropod

Hi vaitrafra,

You can't use a catalogue merge to add rows to a Word table. In the examples I just posted, the merged records are written out to
separate rows in the body of the document. You could format those rows with a table-like layout.
 
V

vaitrafra

uhm.

I understand but i think it's a huge limitation.
I can't use tab separator becouse i have very long descriptions and there's
no chance to obtain a nice formatted document.

I wrote an VB6 Addin that creates the table and populates it with merge
fields, but the solution is neither elegant nor secure.
In fact, the data is obtained from MS Dynamics CRM via mail merge templates.
The Addin solution works with the web interface data source, (that is, a txt
file created by the mail merge macro from CRM) but can not work with outlook
client for CRM that works on a different implementation to obtain the MM
datasource.

I can read the Datasurce object programmatically, but it doesn't return the
rowcount property which i need to predict how many table lines will be
inserted in the document.

so, i will move the question to the CRM community.

Thanks so much for the replyies.

macropod said:
Hi vaitrafra,

You can't use a catalogue merge to add rows to a Word table. In the examples I just posted, the merged records are written out to
separate rows in the body of the document. You could format those rows with a table-like layout.

--
Cheers
macropod
[MVP - Microsoft Word]


vaitrafra said:
Hi all,
I searched the web but it seems i can't find my answer.

I'm trying to populate a table via mail merge.

It's the common situation of a commercial quote where in the first MM record
you wnat to print the headline with addresses etc. and from the second record
to the end you have to print out a product table with descriptions and prices.
I cant find a way to tell to MM to populate the table consequentially,
without creating an entire new table for each record but advancing to a new
row at every one (like pressing tab in the last cell of the row).

Thanks.

P.S. I know that's the worst english ever, but i'm italian, cant help it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top