View Single Post
 
Old 08-08-2018, 08:24 AM
BernaDev202 BernaDev202 is offline Windows 7 32bit Office XP
Novice
 
Join Date: Aug 2018
Posts: 2
BernaDev202 is on a distinguished road
Default Drop down fields in Word - Change color of cell, then add text

By reading previous threads on the subject, I've been able to create a color-coded drop down field in a Word table using the following:

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
  Select Case .Title
    Case "Relationship_Legal Team1"
      With .Range
        Select Case .Text
          Case "Advocate"
            .Cells(1).Shading.BackgroundPatternColorIndex = wdGreen
            .Font.ColorIndex = wdGreen
          Case "Endorser"
            .Cells(1).Shading.BackgroundPatternColorIndex = wdLightGreen
            .Font.ColorIndex = wdBrightGreen
          Case "Neutral"
            .Cells(1).Shading.BackgroundPatternColorIndex = wdDarkYellow
            .Font.ColorIndex = wdDarkYellow
          Case "Blocker"
            .Cells(1).Shading.BackgroundPatternColorIndex = wdRed
            .Font.ColorIndex = wdRed
          Case "None"
            .Cells(1).Shading.BackgroundPatternColorIndex = wdWhite
            .Font.ColorIndex = wdWhite
          Case Else
            .Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
            .Font.ColorIndex = wdAuto
        End Select
      End With
  End Select
End With
But is there a way for a user to also type text into the same field?

For instance, in the business development form I'm creating, the user selects a relationship type from the drop-down and the cell changes accordingly:

Relationship:
Advocate (Green)
Endorser (Bright Green)
Neutral (Dark Yellow)
Blocker (Red)
None (White)

Then, after the relationship type is selected and the cell changes color, I want the user to be able to add an initial (in white) to identify what type of power that relationship has:

D (Decision Maker)
A (Authority-wielder)
I (Influencer)
O (Observer)

It would ultimately look how it does in the attached image.

Any info would be much appreciated.
Attached Images
File Type: png R_P Metrics.png (85.0 KB, 21 views)

Last edited by macropod; 08-08-2018 at 03:04 PM. Reason: Added code tags
Reply With Quote