
Signature
Regards.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
I posted the question in this thread because it is exactly what I'm having a
problem with - performing calculations using merge fields. I have become
accustomed to getting yelled at by moderators for starting another thread
with the same subject, so I opted to post under this. Sorry if this too is
wrong.
As for the problem, I don't know how granular you want me to get, so I'll
start from the very beginning and apologize if it's long.
The document I'm trying to build is an invoice that sales would be able to
generate invoices with from our sales system. Searching the internet, I came
upon a template that seemed like what I was looking for. One row across
citing Product Name, Product Unit Price and the last giving the Total Price
for the product. A Grand Total column totals all the lines above it using
=SUM(TOTAL). As our product is a software service sold on a yearly basis, it
would be ideal to have some way for the one template to accommodate every
multi-year scenario we have. I used the ASK code to prompt the user to enter
in the number of years that the deal was for. This value is stored in a
bookmark called YEARS, and this in turn is used in a field that calculates
the cost per year.
So far as I can tell, I need the proper syntax to multiply a mergefield by a
bookmark and have it format as a dollar amount. I need to multiply the
Product Unit Price mergefield by the value entered into the YEARS bookmark by
the user to get the Total Price for each product on each line of the invoice.
Adding a quantity field with a fixed number is not possible because of the
way finance set up the sales system. I found a page in the Microsoft Help
and Support site titled "WD: Performing Calculations in a Mail Merge Field"
which had some examples of calculations, but every time I try entering the
formulas into the word document, it gives me the "!SyntaxError" message.
I hope this explains my problem better and thank you for any help you can
give me.
> Is this a continuation of the original thread under which it appears or a
> new and different situation.
[quoted text clipped - 19 lines]
> > Unit
> > Price without getting an error message during the merge.
Doug Robbins - Word MVP - 25 May 2007 16:15 GMT
There are no moderators in these newsgroups and when people post under names
such as thatangrykid into a thread posted by cjlatta where, at least I
thought my last response should have fixed the issue, it was not an
unreasonable question to ask, otherwise I would have been quite likely to
have just said "See my previous response"
In your case, while I would not use mailmerge to create documents such as
this, if you want to get the product of a mailmerge field and the content of
a bookmark, you need to use a { REF bookmarkname } field to get the contents
of the bookmark
The calculation would then be
{ = { MERGEFIELD fieldname } * { REF bookmarkname } }
If you are getting syntax errors, the best way to get help would be to
include in your post the field construction that you have that is giving the
error.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I posted the question in this thread because it is exactly what I'm having
>a
[quoted text clipped - 71 lines]
>> > Unit
>> > Price without getting an error message during the merge.
thatangrykid - 25 May 2007 17:06 GMT
Thanks for the help. I'll repay the favor by never coming here again.
> There are no moderators in these newsgroups and when people post under names
> such as thatangrykid into a thread posted by cjlatta where, at least I
[quoted text clipped - 90 lines]
> >> > Unit
> >> > Price without getting an error message during the merge.
Peter Jamieson - 25 May 2007 17:50 GMT
> by never coming here again.
Well, that's a relief.
Peter Jamieson
> Thanks for the help. I'll repay the favor by never coming here again.
>
[quoted text clipped - 124 lines]
>> >> > Unit
>> >> > Price without getting an error message during the merge.
Doug Robbins - Word MVP - 25 May 2007 18:08 GMT
Sorry, I did not realise that you were posting under your real name.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks for the help. I'll repay the favor by never coming here again.
>
[quoted text clipped - 124 lines]
>> >> > Unit
>> >> > Price without getting an error message during the merge.
Noel - 28 Oct 2008 18:06 GMT
I am merging from an Access Database, I need to subtract two fields and so
would I post it as
{={MERGEFIELD Quarterly_Cost} - {MERGEFIELD QuarterlySubsidy}}
> Sorry, I did not realise that you were posting under your real name.
>
[quoted text clipped - 126 lines]
> >> >> > Unit
> >> >> > Price without getting an error message during the merge.
Peter Jamieson - 28 Oct 2008 18:25 GMT
Yes, as long as all three pairs of {} are the special field code braces that
you can insert using ctrl-F9. Everything else is plain text.

Signature
Peter Jamieson
http://tips.pjmsn.me.uk
>I am merging from an Access Database, I need to subtract two fields and so
> would I post it as
[quoted text clipped - 150 lines]
>> >> >> > Unit
>> >> >> > Price without getting an error message during the merge.