Hi,
unprotect the doc, like this,
to avoid an error, if it is already unprotected:
' ---------------------------------------------
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect
End If
End With
' ---------------------------------------------
Add checkboxes, in case they aren't already there,
in a rather quick and dirty way, beware:
' ------------------------------------------------
Dim oPrg As Paragraph
Dim rTmp As Range
For Each oPrg In ActiveDocument.Paragraphs
Set rTmp = oPrg.Range
rTmp.Collapse Direction:=wdCollapseStart
If Asc(oPrg.Range.Characters.First) <> 21 Then
oPrg.Range.FormFields.Add _
Range:=rTmp, _
Type:=wdFieldFormCheckBox
End If
Next
' ------------------------------------------------
Protect the doc, in case it isn't protected,
like this, to avoid an error:
' -------------------------------------------
With ActiveDocument
If .ProtectionType = wdNoProtection Then
.Protect wdAllowOnlyFormFields
End If
End With
' -------------------------------------------
Get the text from the checked paragraphs, like this:
' -------------------------------------------
Dim oFld As FormField
Dim sTmp As String
For Each oFld In ActiveDocument.FormFields
If oFld.Type = wdFieldFormCheckBox Then
If oFld.Result = True Then
sTmp = oFld.Range.Paragraphs(1).Range.Text
sTmp = Right(sTmp, Len(sTmp) - 1)
MsgBox sTmp
End If
End If
Next
"like this" means there maybe other and better ways.
Lots of complications possible, e.g. tables, textframes, ...
HTH
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"