Class CheckBox (Word VBA)

The class CheckBox represents a single check box form field.


To use a CheckBox class variable it first needs to be instantiated, for example

Dim cbx as CheckBox
Set cbx = ActiveDocument.FormFields(1).CheckBox

CheckBox class variables can be set using the FormField.CheckBox procedure.


True sizes the check box or text frame according to the font size of the surrounding text. False sizes the check box or text frame according to the Size property.

ActiveDocument.FormFields(1).CheckBox.AutoSize = True


Returns or sets the default check box value. True if the default value is checked.

Dim booDefault As Boolean 
If ActiveDocument.FormFields(1).Type = wdFieldFormCheckBox Then 
 booDefault = ActiveDocument.FormFields(1).CheckBox.DefaultEnd If


Returns an object that represents the parent object of the specified CheckBox object.

Dim objParent As Object
Set objParent = ActiveDocument.FormFields(1).CheckBox.Parent


Returns or sets the size of a check box, in points.

With ActiveDocument.FormFields("Check1").CheckBox 
 .AutoSize = False 
 .Size = 14 
 .Value = True 
End With


True if the specified form field object is a valid check box form field.

Selection.Collapse Direction:=wdCollapseStart 
Set myFormField = ActiveDocument.FormFields.Add(Range:= _ 
 Selection.Range, Type:=wdFieldFormTextInput) 
MsgBox myFormField.CheckBox.Valid


True if the check box is selected.

ActiveDocument.FormFields(1).CheckBox.Value = True