View Single Post
 
Old 05-05-2019, 08:25 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

I didn't test those and I suppose they work, but I don't see the point of strCheckBoxName or bCheckBoxValue or rngCheckBoxSlct??


Code:
Sub Test()
Dim lngIndex As Long
Dim oFld As FormField
  If Not ActiveDocument.ProtectionType = wdNoProtection Then
    ActiveDocument.Unprotect Password:=""
  End If
  For lngIndex = ActiveDocument.FormFields.Count To 1 Step -1
    Set oFld = ActiveDocument.FormFields(lngIndex)
      If oFld.Type = wdFieldFormCheckBox Then
        If oFld.CheckBox.Value = True Then
          oFld.Range.Text = "1"
        Else
          oFld.Range.Text = "0"
        End If
      Else
        oFld.Range.Text = oFld.Result
      End If
  Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote