View Single Post
 
Old 01-09-2016, 05:17 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Put the following code in the ThisDocument module of your VB Project:

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oRng As Word.Range
  Set oRng = ContentControl.Range.Paragraphs(1).Next.Range
  Select Case ContentControl.Title
    Case "A" 'Change to match your titles
      If ContentControl.Checked Then
        oRng.Text = "XXXX "
        oRng.Collapse wdCollapseEnd
        oRng.Select
      End If
    Case "B" 'Change to match your titles
      If ContentControl.Checked Then
        oRng.Text = "YYYY "
        oRng.Collapse wdCollapseEnd
        oRng.Select
      End If
    Case "C" 'Change to match your titles
      If ContentControl.Checked Then
        oRng.Text = "ZZZZ "
        oRng.Collapse wdCollapseEnd
        oRng.Select
      End If
  End Select
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote