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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I add decimal points to a mail merge field?

Status
Not open for further replies.

lesj1968

Programmer
Joined
Sep 3, 2005
Messages
166
Location
GB
Hi

I have added mail merge fields to a Word Template and all gets exported fine from the data source. However all numbers are coming out with inconsistant decimal points. I want someway to format all mail merge fields so they have only two decimal points. Is there some way to do this?

Also is there a way to make a mail merge field only once in Word? I am exporting quote details with a customer address and product details - however the address keeps appearing every time for each product. Ideally I want the address to appear only once and then a list of the products follow. The only way I have temporarily solved this is to have the customer address in the header, however it still appears on every page. Also, if there is someway to only show the total field just once, at the end of the document that would be ideal. At the moment I have the total appearing in the footer, however this too appears on each page. NB each merged document only contains quote information for one customer only.

Thank you very much for any help.

Less
 
I forgot to ask...is there a function for a page break...i.e to make the output start at the beginning of the next page?
 
Hi Less,

Have a look at my reply to a recent thread:

which is about similar problems and check the urls I have listed.

Specifically:
1. Decimal points - you can specify the format of fields you are printing to two decimal places as follows:
{ = Cost + Tax \# $#,##0.00 } where the \# indicates the format follows - check Mergeformat in Word help

2. Address to appear only once - You will need to have an If in the field to specify your requirements. Check under Field and then "Field codes: IF field".

3. Total Field only at end - similar to above.

Also you might find this site useful:

Good Luck!

Peter Moran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top