![]() |
|
#1
|
|||
|
|||
|
Hi all,
I have a mail merge field in my Word 2010 document that contains a check box control that is checked or not depending on the content from the input list. {IF NEW = "NEW" "☒" "☐"} where those boxes are actually check box controls However, after the mail merge is complete, the check box control is replaced with a symbol for the checked or unchecked box, as appropriate. As a result, one can no longer switch from checked to unchecked in the final document as you would for a check box control. I am looking for a simple way to find the checked or unchecked symbol in the output document and replace it with a check box document control in the appropriate state. I'm not big on programming, but if you could point me in the right direction, I'll try my best. I have played around with VB Macros in the past (very amateur), so I tried that again and got this far as a "proof of concept": Code:
Sub Checkbox()
' ChrW(9744) is unchecked box; 9746 is checked box
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ChrW(9744)
.Replacement.Text = ChrW(9746)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
End Sub
Code:
Selection.Range.ContentControls.Add (wdContentControlCheckBox) |
| Tags |
| check box, mail merge, word 2010 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
how to find and replace a symbol with another symbol
|
wondermuse | Word | 5 | 10-09-2014 06:30 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |
| Word2010 check boxes and plain text content control boxes in same table | fcsungard | Word | 5 | 06-01-2012 01:16 AM |
Check box symbol
|
jdthelen | Word | 1 | 09-07-2009 01:43 PM |
| Excel ->VB code for Checkbox (control toolbox) | kirkstyle | Excel | 0 | 08-16-2006 04:17 PM |