![]() |
|
#1
|
|||
|
|||
|
I have code which will change the colour on a content control drop down when the macro isrun, but I would like it to run automatically when I exit the content control, please could you advise?
Sub AddColour() Dim cc1 As ContentControl Set cc1 = ActiveDocument.SelectContentControlsByTitle("Ratin g").Item(1) If cc1.Title = "Rating" Then Select Case True Case cc1.Range.Text = "Feasible" cc1.Range.Shading.BackgroundPatternColor = wdColorGreen Case cc1.Range.Text = "Less Feasible" cc1.Range.Shading.BackgroundPatternColor = wdColorYellow Case cc1.Range.Text = "Not Feasible" cc1.Range.Shading.BackgroundPatternColor = wdColorRed Case Else cc1.Range.Shading.BackgroundPatternColor = wdColorAutomatic End Select End If End Sub |
| Tags |
| content control, vba change colour |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Table with content control drop down - change font | DebA | Word | 3 | 04-29-2018 09:07 PM |
Is there a way to anchor drop-down content control boxes so entering text doesn't change formatting?
|
TzarChasm | Word | 7 | 04-14-2016 06:28 PM |
Code to Sum Column of Content Control Values In Specific Tables?
|
warbird | Word VBA | 2 | 07-13-2015 05:44 AM |
| a code that can change the layout for the headers and footers on each page automatically | gmbh | Word VBA | 1 | 07-31-2014 04:24 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |