Thread: [Solved] Checkbox
View Single Post
 
Old 03-22-2020, 05:43 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you use a checkbox content control titled 'Chk1', for example, and a corresponding text content control titled 'Chk1Inits', you could use a ContentControlOnExit macro like:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
With CCtrl
  If .Type = wdContentControlCheckBox Then
    With ActiveDocument.SelectContentControlsByTitle(.Title & "Inits")(1)
      .LockContents = False
      .Range.Text = Application.UserInitials
      .LockContents = True
    End With
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote