View Single Post
 
Old 10-03-2014, 07:07 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

What type of dropdown are you using? Word doesn't have a built-in "change" event for content control dropdowns, but you could use the OnEntry and OnExit events:

Code:
Dim oCell As Cell
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
  Select Case ContentControl.Title
    Case "Demo"
      Set oCell = Selection.Cells(1)
   End Select
End Sub
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
  Select Case ContentControl.Title
    Case "Demo"
      Select Case ContentControl.Range.Text
        Case "A": oCell.Shading.BackgroundPatternColorIndex = wdBrightGreen
        Case "B": oCell.Shading.BackgroundPatternColorIndex = wdDarkRed
      End Select
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote