![]() |
|
|
|
#1
|
||||
|
||||
|
The problem was that you'd deleted the placeholder text for the two date controls. The following macro will fix that: Code:
Sub FixDateCtrls()
With ActiveDocument.SelectContentControlsByTitle("Select Date")
.Item(1).SetPlaceholderText Text:="Select Date"
.Item(2).SetPlaceholderText Text:="Select Date"
End With
End Sub
Try the following: Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
With CCtrl
Select Case .Title
Case "Select"
Select Case .Range.Text
Case .PlaceholderText, "n/a", "If Yes, Select"
.Range.Font.ColorIndex = wdRed
Case Else
.Range.Font.ColorIndex = wdAuto
End Select
Case "Select Date"
Select Case .Range.Text
Case .PlaceholderText
.Range.Font.ColorIndex = wdRed
Case Else
.Range.Font.ColorIndex = wdAuto
End Select
With .Range.Font
.Size = 8
.Italic = True
End With
Case Else
End Select
End With
Application.ScreenUpdating = True
End Sub
You might also want to set each content control's 'cannot be deleted' property, to guard against errant users.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| color, conditional formatting, list |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Conditionally Color Formatting Text selected from a dropdown list in Word 2010
|
pgammag | Word | 9 | 08-20-2019 04:17 PM |
| Dropdown conditional formatting | tlkc67 | Word VBA | 6 | 10-05-2014 10:54 AM |
Conditional formatting that ignores other formatting rules
|
info_guy2 | Excel | 1 | 07-03-2014 10:07 AM |
| Dropdown List in Microsoft Word 2010 | bfarquhar | Word | 2 | 04-02-2014 07:48 PM |
link conditional info in word based on excel list
|
stijnvanhoof | Mail Merge | 1 | 11-13-2012 01:55 PM |