![]() |
#6
|
||||
|
||||
![]()
If you were to use E-Mail Merge Add-in or Merge and Split to merge your document to separate documents and the field was inserted in the merge document as
{ MERGEFIELD IMMUNIZATIONS } Immunizations then you could run a macro on the fly to replace the value with a check box content control, either checked or not according to the value. e.g. Code:
Sub FixCheck(oDoc) Dim oChk As Range Dim oWord As Range Dim oCtrl As ContentControl Dim bVal As Boolean Set oChk = oDoc.Range With oChk.Find Do While .Execute(findText:="Immunizations") Set oWord = oChk.Previous.Words.Last Select Case LCase(Trim(oWord.Text)) Case "yes": bVal = True Case "no": bVal = False End Select Set oChk = oWord Set oCtrl = oChk.ContentControls.Add oCtrl.Range.Text = "" With oCtrl .Type = wdContentControlCheckBox .Title = "Immunizations": .Tag = .Title .Checked = bVal .LockContentControl = True End With Exit Do Loop End With lbl_Exit: Set oChk = Nothing Set oWord = Nothing Set oCtrl = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
sureshbvs | Word VBA | 1 | 03-12-2021 05:42 AM |
![]() |
djrexy | Mail Merge | 1 | 05-20-2020 04:04 PM |
![]() |
shawn.low@cox.net | Mail Merge | 3 | 09-25-2019 04:05 PM |
simple checkbox in e-mail as a signature | angie0923 | Word | 0 | 11-03-2016 12:26 PM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |