Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge List by Name 1

Status
Not open for further replies.

supportservice

Technical User
Mar 12, 2012
63
0
0
I found an article and I can't seem to make it work.

This is the part that I would like to use:

[link]http://support.microsoft.com/kb/211303/en-us[/url]

I've replaced it with my field names here:

Code:
{ If { MERGESEQ } = "1" "{ MERGEFIELD «VendorName»}" ""}
{ SET Place1 { MERGEFIELD «VendorName»}}
{ If { Place2 } <> { Place1 }"
----------------------------Page Break--------------------------------
{ MERGEFIELD VendorName }

{ InvoiceNo: «PayInvoiceNo»}{ InvoiceDueDate: «InvoiceDueDate»}{ NetInvoice: $«NetInvoice»}" "{ InvoiceNo: «PayInvoiceNo»}{ InvoiceDueDate: «InvoiceDueDate»}{NetInvoice: $110.40000000000001}" }{ SET Place2 { «VendorName»}}

It is not resulting like the example.

This is what I am getting:
Code:
{ If { MERGESEQ } = "1" "{ CINTAS - Desert}" ""}
{ SET Place1 { CINTAS - Desert}}
{ If { Place2 } <> { Place1 }"
----------------------------Page Break--------------------------------
{ CINTAS - Desert}

{ InvoiceNo: 150679525}{ InvoiceDueDate: 9/10/2012}{ NetInvoice: $110.40000000000001}" "{ InvoiceNo: 150679525}{ InvoiceDueDate: 9/10/2012}{NetInvoice: $110.40000000000001}" }{ SET Place2 { CINTAS - Desert}}[/coce]

The fields laid out in this example produce a catalog listing on separate pages as follows:

It should produce:
ACC Business

12345 9/20/12  $3,000
23456 9/30/12 $50,000
45566 9/27/12 $10,000

----------------------------Page Break-----------------------------
CINTAS - Desert

InvoiceNo: 150679525  InvoiceDueDate: 9/10/2012  NetInvoice: $110.40000000000001
InvoiceNo: 150679587  InvoiceDueDate: 9/10/2012  NetInvoice: $235.00000000000001


What am I doing wrong?
 
I can't help it if you can make the right selection - which is detailed in the tutorial and is no more difficult that clicking on the the 'Directory' button when specifying the merge type ...

Cheers
Paul Edstein
[MS MVP - Word]
 
Sorry. Directory is Selected.

Code:
Word 2003
On the Tools Menu, click Letters and Mailings > Mail Merge > Directory. Then go to step ‎0.
That is done.
 
'go to step ‎0' should read 'go to step ‎2'. Having done that, now all you need to do is to follow the rest of the tutorial's instructions for setting up the document - your attachment isn't set up anything like what the tutorial describes.

Cheers
Paul Edstein
[MS MVP - Word]
 
Ok all steps 2-8 are done and easy enough.

Grouping the Records
When preparing for a 'Catalog' or 'Directory' mailmerge in which you want to group records according to a 'Key' field, it is important that you ensure that the records get sorted according to that field. You have two options:
1. Sort your data file so that all records with the same 'Key' field value are grouped together.
2. After setting up your main document, use the mailmerge helper’s ‘Query Options’ to order the records by the 'Key' field during the merge process. With this approach, your data remains in its original order and the mailmerge process does the sorting internally.

1. Sorted on 'Key' which is VendorName. This is done
2. I can't find Query Options?

 
In Word 2003, all you need to do is to click on the 'Mailmerge Recipients' button, then sort the data by whatever you're using for the 'key' field (in this case, VendorName).

Cheers
Paul Edstein
[MS MVP - Word]
 
Sorry. But that is all ready done.

I am stuck at this point then

Code:
Force Each New Category To a New Page
A minor change to the field coding from the previous examples inserts a page break whenever the key field changes. The following field codings show how you might go about this:
•	with the ‘City’ field as the key field –
«State»	«City»

	«Representative»	«Sales»

•	or, with the ‘State’ field as the key field –
«State»

«City»	«Representative»	«Sales»

Note: The 'QUOTE 12' field creates the page break. If that seems confusing, you could replace that field with a manual page break, by pressing Ctrl-Enter, or you could replace it with a ‘Next Page’ Section break.
The fields in the above examples produce the same listings as previously, but with page breaks separating them at the 'Key' changes

I appreciate your patience.

I tried to replace the code from MS site exactly using the Ctrl+F9
When done it comes up completely blank now?
 
Why are you using code from the MS site? All of the code you might require is in the tutorial.

Cheers
Paul Edstein
[MS MVP - Word]
 
Because, sadly, I am not getting. So I am trying to incorporate what seems to be more helpful re: Code, add your explaining ... but I am coming up quite short.

I realize how much I do not know Word. Have just used in it's simplest form of word processing only.

This is quite complex, at least for me if you haven't noticed [bugeyed]
 
Well, all I can say is that you're not doing yyourself any favours trying to cobble something together from two disparate sources.

The MS code is, IMHO, quite rudimentary, and is certainly not at all suitable for what you say you're trying to do.

Cheers
Paul Edstein
[MS MVP - Word]
 
Yes and I thought perhaps with the code and your tutorial will help.

You say all the code is in your tutorial ... apparently I am not seeing it??

Code:
NSW

Coffs Harbour	Roulston	$4,000
Dubbo	Kristiansen	$6,700
Newcastle	Avard	$3,400
Newcastle	James	$8,600
Sydney	Brown	$5,300
Sydney	Driver	$8,700
Sydney	Gadzic	$7,400
Sydney	Williams	$700
Wollongong	Day	$6,200
Wollongong	McFarlane	$8,100

After all this time I still cannot figure out how to make the list.

I have it set to Directory. Which merging it to a new doc creates the continues result of each record per VendorName. So you have the part in your tutorial for the page break. But I have the separate page per each record??

I am not seeing where the code that is required to make the list show on each page or simply I am not getting it since you are stating the code I need is in fact in your document.

Yes, I am sorry I am dense with this. It's frustrating me.
 
Please read 'Viewing The Fields' in the Introduction ...

Cheers
Paul Edstein
[MS MVP - Word]
 
I'm sorry. Not sure what that'll do with the problem?

I know how to select the field then right-click to toggle field codes
 
If you know that, then how is it you're saying:
I am not seeing where the code that is required to make the list show on each page or simply I am not getting it since you are stating the code I need is in fact in your document.
There's a plethora of field codes in the tutorial. Alt-F9 will reveal them all.

Cheers
Paul Edstein
[MS MVP - Word]
 
Yes and as mentioned I inserted the code that is supposed to list the invoices per Vendor but it is not. Even after making sure Directory is selected.

This why I do not get what I am doing wrong.
 
Have you had a look at the worked examples in the links I provided? See also:
When you've done it properly, you should end up with a field code like:
Code:
{QUOTE{IF{MERGESEQ}= 1 "{SET Key ""}{SET Tot 0}"}"{IF{MERGEFIELD VendorName}<> {Key} "{IF{MERGESEQ}> 1 "
|    |    |    |  TOTAL: |  {=Tot \# ,0.00}  |

{SET Tot 0}"}{IF{MERGEFIELD VendorName}<> {Key} "{IF{MERGESEQ}> 1 "



supportservice
"}{IF{MERGEFIELD VendorName}<> 0 "{IF{MERGESEQ}> 1 {QUOTE 12}}{SET Key {MERGEFIELD VendorName}}{DATE \@ "DD-MMM-YYYY"}

Dear Accounts Receivables Department of {MERGEFIELD VendorName}
Please charge credit card on file for the following invoice(s):

|Invoice Number|Invoice Due Date|Invoice Amount|Discount Amount|Net Invoice Amount|
"}"}"}{IF{MERGEFIELD VendorName}<> 0 "
|{MERGEFIELD PayInvoiceNo}|{MERGEFIELD InvoiceDueDate}|{MERGEFIELD InvoiceAmt \# "$,0.00"}|{MERGEFIELD DiscountAmt \# "$,0.00"}|{ MERGEFIELD NetInvoice \# "$,0.00"}|
{SET Tot {=Tot+{MERGEFIELD NetInvoice}}}"}"}
where the | characters represent cell dividers.

In fact, the above is very closely based on the field in the document in the post referred to in the above link.

Cheers
Paul Edstein
[MS MVP - Word]
 
Never mind!

I finally got it working now!

Thank you so very much!

I am extremely grateful for your patience with me and helping me with this!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top