How to Suppress a GoldMine Word Merge Field if the GoldMine Value is 0 or Empty

1. In your Word template, put the cursor at the position you want the field.
2. Press CTRL + F9.
3. This puts a blank field code in the documents.  Your cursor is now between the braces.
4. Type the word IF then a space then the ” symbol.
5. Press CTRL + F9 to insert another field inside the first one.
6. Now type our Goldmine codes as follows:
DDEAUTO GOLDMINE DATA CONTACT2->UFIELD \* CHARFORMAT
where UFIELD is your Goldmine field.  This will vary depending on the table and field.
7. Move the cursor past the first } symbol.
8. Type another symbol.
9. Type the two symbols < and > followed by a space.
10. Type another symbol.
11. Press CTRL + F9 to insert another field.
12. Again type DDEAUTO GOLDMINE DATA CONTACT2->UFIELD \* CHARFORMAT.
13. Between the last to } symbols type ” a space then two ” symbols.

You should end up with a series of codes that looks like this:
{IF “{DDEAUTO GOLDMINE DATA CONTACT2->UFIELD \* CHARFORMAT}” <> “0” “{DDEAUTO GOLDMINE DATA CONTACT2->UFIELD \* CHARFORMAT}” “”}
In English this field is saying If the contents of UFIELD is less than or greater than 0 put the contents of UFIELD into this position otherwise put nothing in (this is the text between the last two “” symbols).  If the value is -1 it gets printed, if it’s 1 it gets printed, if it’s zero the field is not put in.
Highlight what you typed, right mouse click and select Toggle Field Codes to view the result.
FYI, while working on this use DDE instead of DDEAUTO.  That way you can change the value in GM, highlight the field in Word and press F9 to update it without having to close and reopen the document.  Once you’re happy with the result, change DDE to DDEAUTO.

GET LATEST NEWS!