Useful Calculation Tricks Using Microsoft Word Field Codes and Mergefields

Microsoft Word Field Code Calculations

What are field codes? They are a byproduct of mailmerge, which is a way for Word to insert values from a database table into your document using replaceable parameters. Field Codes go one step further and allow you to define additional symbols and temporary or intermediate storage that is somewhat unreliable and unpredictable. You can perform calculations using the merge fields and intermediate values. With limited precision, you can perform floating point math. You will never get more that 8 digits of PI with Word. 

From the Insert Ribbon Menu, there is a button called "Quick Parts" that will have a button called Fields. From this there is a Formula button, that will expose the limited library of functions to use. As for Math functions, there is multiply or * powers or ^ and + - /  There is also a logic concept with IF then and else.

Always press Ctrl-F9 key sequence to insert a field code or mergefields. The following examples were created using ICE Mortgage Encompass, using Custom Print Forms. These were tested with Microsoft Office 2016. They should work on all versions.

In Encompass, to edit a custom form that you can print+merge with fields from Encompass

Encompass Settings -> Loan Setup -> Custom Print Forms

then edit a form, it will open up Microsoft Word and show you an Insert Fields dialog box

Example 1:

Calculations with Field Codes
Example Calculations with Field Codes

Example 2:

A quote block containing field codes and intermediate variables. In this example r2, r3, r4 and px will become 0.000 due to sequencing issues. MS Word is not a procedural language and does not follow normal program timing rules.

The Mortgage Payment Calculation

Display the Values


Run the Merge and See the Results

From a loan file form that shows the loan amount, interest rate and term, Print the form.

As you can see, some of the variables did not get their values. The monthly mortgage payment was correct, while the value of PI suffered from rounding.  We could not get 10 digits of PI.

References:

Comments

Popular posts from this blog

Microsoft Visio 2010 Premium Product Keys

Configure Shoretel Voicemail Notifications to your email inbox using a free SMTP relay

Microsoft Office365 Authentification Methods Settings