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

AutoSize

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

Default

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

Size

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


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

Valid

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

Value

True if the check box is selected.


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