How to embed calculations in MS word
The type of document I have in mind is a bid or a contract. It has many values, such as prices and dates, scattered within the text. For years I have used DOCPROPERTY fields to avoid copying-and-pasting them, where they are the same (e.g. final price may occur 10 or 20 times in a document). But I think this could go even further, as it would be easiest if some values could be calculated from others.
For example, by using field syntax {DOCPROPERTY "final_price"} I can refer to that property as defined in document properties.
Also, field syntax {=100*1.07} will yield 107.
However, if I try this: {={DOCPROPERTY "final_price"} * 1.07}, in various configurations of braces and brackets, all I get is syntax errors.
Documentations is scarce. Can anybody help?
Make sure to create proper field codes, one inside the other, like this:
- Press
CTRL + F9
- Put in
=*1.07
between the braces - Click between
=
and*
- Press
CTRL + F9
again - Put in
DOCPROPERTY "final_price"
between the braces - Press
Alt + F9
to toggle field codes - Press
F9
to update the field
Have a look at the Word addin at www.wordequate.com. It allows live calculations using the Word equation editor.