[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 578
  • Last Modified:

Populate Word Merge Check Box from exported txt file data (0 vs. 1)

I'm using an Access form to collect data for a MS Word Mail Merge document.  In addition to name and address fields, the Access form collects data for several Check Boxes.  I export the Access data to a comma delimited text file that the Word document references.  My question is how I get Check Box fields on the Mail Merge document to either populate or not-populate based on the 0 or 1 that is in the exported text file.  So, if the txt file for the first record has a 1 in the appropriate field I want a filled in Check-Box on the letter, vs. a blank Check Box.

I've exhausted the obvious options in Word help, and can't believe that there isn't a way to do this.  Any help/thoughts/ideas would be greatly appreciated.  All else fails, I suppose I can change the Access database to export a literal "X" to the text file.  I'd rather have the nice Check Box Form field available in Word though.

Thanks for your time.
  • 2
  • 2
1 Solution
To set a checkbox on:

AvtiveDocument.FormFields("Check1").CheckBox.Value = True

'Off' is, of course' False
bdbudAuthor Commented:
This makes sense, but not sure if it applies to my situation.
I want to turn the 0's and 1's from the text file data source:

12345,"Someone","Name1","Address"," ","City","State",ZIP,0,1,"November",0,0

to either checked or unchecked boxes on the Word merge doc.  Hope that makes sense.  I'm hoping the 0's and 1's in the data source can control the Check Box on the Merge document.
Sorry. I thought that you were wanting to use a separate mechanism from MailMerge to fill in some FormFields.

Form Fields and Merge Fields are very different and would rarely find themselves on the same document. Indeed, I have just tried, with an unsurprising lack of success, to nest a checkbox form field inside a merge field and get the merge to fill it that way.
What you can do is to nest the mergefield in an IF field, and to show an character representing a tick or a cross, depending on the result.

To work with fields, it is better to show the field codes, rather that the field results. Use Alt+F9 to toggle between the two displays. Also, remember that the {} pairs are not inserted using the shifted [ and ] keys, but with Ctrl+F9 or as part of a Field Insert.

To further complicate things, I have found a couple of WingDing symbols which I can't reproduce here, but which can be inserted into the IF field. They are reported on the insert Symbol dialogue to have character codes 253 and 254 respectively. They are represented below with / (for tick) and X. Use Insert Symbol to put them in your field code.
Here I have named the merge field : "Maybe". Note that the quotes are generally optional in fields unless   the text item has a space in it.

This is what the field code looks like:

{ IF { MERGEFIELD "Maybe" } = 1 "/" "X" }

bdbudAuthor Commented:
Perfect!  That'll work!!  Stretching the envelope.

Thanks for your help!

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now