The following should work for you
Code:
Select Case True
Case Chbx2 = True And Chbx3 = True And Chbx4 = True And Chbx5 = True And Chbx6 = True
FillBM "First", "CheckBox2, CheckBox3, CheckBox4, CheckBox5 and CheckBox6"
Case Chbx2 = True And Chbx3 = False And Chbx4 = True And Chbx5 = False And Chbx6 = True
FillBM "First", " CheckBox2, CheckBox4 and CheckBox6"
End Select
The code calls the following sub to write the value to the named bookmark
Code:
Public Sub FillBM(strbmName As String, strValue As String)
'Graham Mayor - https://www.gmayor.com
Dim oRng As Range
With ActiveDocument
On Error GoTo lbl_Exit
If .Bookmarks.Exists(strbmName) = True Then
Set oRng = .Bookmarks(strbmName).Range
oRng.Text = strValue
oRng.Bookmarks.Add strbmName
End If
End With
lbl_Exit:
Set oRng = Nothing
Exit Sub
End Sub
You might consider using a content control instead of a bookmark as content controls are less likely to be accidentally deleted. The following will write to a titled content control
Code:
Public Sub FillCC(strCCTitle As String, strValue As String, bLock As Boolean)
'Graham Mayor - https://www.gmayor.com - Last updated - 03 Sep 2021
Dim oCC As ContentControl
On Error GoTo lbl_Exit
For Each oCC In ActiveDocument.ContentControls
If oCC.Title = strCCTitle Then
oCC.LockContents = False
oCC.Range.Text = strValue
oCC.LockContentControl = True
oCC.LockContents = bLock
Exit For
End If
Next oCC
lbl_Exit:
Set oCC = Nothing
Exit Sub
End Sub