View Single Post
 
Old 08-08-2018, 03:31 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Perhaps:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
With CCtrl
  Select Case .Title
    Case "Relationship_Legal Team1"
      If .Type = wdContentControlDropdownList Then
        With .Range
          Select Case .Text
            Case "Advocate"
              .Cells(1).Shading.BackgroundPatternColorIndex = wdGreen
              .Font.ColorIndex = wdWhite
            Case "Endorser"
              .Cells(1).Shading.BackgroundPatternColorIndex = wdBrightGreen
              .Font.ColorIndex = wdWhite
            Case "Neutral"
              .Cells(1).Shading.BackgroundPatternColorIndex = wdDarkYellow
              .Font.ColorIndex = wdWhite
            Case "Blocker"
              .Cells(1).Shading.BackgroundPatternColorIndex = wdRed
              .Font.ColorIndex = wdWhite
            Case "None"
              .Cells(1).Shading.BackgroundPatternColorIndex = wdWhite
              .Font.ColorIndex = wdWhite
            Case Else
              .Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
              .Font.ColorIndex = wdAuto
            End Select
          End With
          If .ShowingPlaceholderText = False Then
            .Type = wdContentControlText
            .SetPlaceholderText , , "Input the Relationship Power"
            .Range.Text = ""
          End If
        Else
          .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
          .Range.Font.ColorIndex = wdAuto
          .Type = wdContentControlDropdownList
          .SetPlaceholderText , , "Choose a Relationship Type"
        End If
  End Select
End With
End Sub
PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote