Hi Paul,
I have posted the question on your other post. But unfortunately it got moved or removed.
The document in the #1 post has help me a little.
But when I am creating a second Checkbox2 its not working.
Second is it possible to allow user to only select one checkbox only.
Can you please guide me and explain in details, how to get it worked.
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
With ContentControl
Select Case .Title
Case "CheckBox1"
If .Checked = True Then
ActiveDocument.CustomDocumentProperties("Chk1").Value = 1
Else
ActiveDocument.CustomDocumentProperties("Chk1").Value = 0
End If
Case "CheckBox2"
If .Checked = True Then
ActiveDocument.CustomDocumentProperties("Chk2").Value = 1
Else
ActiveDocument.CustomDocumentProperties("Chk2").Value = 0
End If
Case Else
End Select
End With
Application.ActiveWindow.View.ShowFieldCodes = False
Application.Options.PrintFieldCodes = False
ActiveDocument.Fields.Update
Application.ScreenUpdating = True
End Sub