From: spunkymuffmonkey on
Hi community, hope we're all well and happy!

I have a document with 60 formfield checkboxes that I require to loop
through to ascertain their value.

I plan to create an array and then use a loop like this and wondered if this
is most efficient/fastest way of doing this, any advice/guidance would be
greatyl apprieciated.

Dim oDoc As Document
Dim blnCheck(0 To 29) As Boolean

Set oDoc = Application.ActiveDocument
y = 0
For i = 34 To 153 Step 4
blnCheck(y) = CBool(oDoc.FormFields("Check" & i).CheckBox.Value)
y = y + 1
Next i

Set oDoc = Nothing
From: spunkymuffmonkey on
I forgot to mention that I only require to know a value for every 4
checkboxes and intend to return values into an array, correcting my code:

Sub ReadContents()
Dim oDoc As Document
Set oDoc = Application.ActiveDocument
y = 0
For i = 34 To 153 Step 4
blnCheck(y) = CBool(oDoc.FormFields("Check" & i).CheckBox.Value)
y = y + 1
Next i

Set oDoc = Nothing

End Sub