![]() |
#7
|
|||
|
|||
![]()
I have just checked the file I sent to you and I can see the macro and the code when I open it and go to the developer tab and macros.
Please see a copy and paste of what I see. End Sub Option Explicit Dim i As Long Private Sub Document_Open() ActiveDocument.Bookmarks("ColourDropDown").Range.S elect Call Index End Sub Sub Index() i = Replace(Selection.FormFields(1).Range.Bookmarks(1) .Name, "ColourDropDown", "") End Sub Sub ColorDropDown() Dim sText As String, oFld As FormField With ActiveDocument Set oFld = .FormFields("Dropdown" & i) sText = oFld.Result If .ProtectionType <> wdNoProtection Then .Unprotect Password:="" With oFld.Range Select Case sText Case Is = "SOP UPDATE" 'green .Font.Color = wdColorBrightGreen .Shading.BackgroundPatternColor = wdColorBrightGreen Case Is = "SAFETY NOTICE" 'yellow .Font.Color = wdColorYellow .Shading.BackgroundPatternColor = wdColorYellow Case Is = "TRAINING UPDATE" 'pink .Font.Color = wdColorRed .Shading.BackgroundPatternColor = wdColorRed Case Is = "ADVISORY BULLETIN" 'grey .Font.Color = wdColorRed .Shading.BackgroundPatternColor = wdColorRed End Select End With .Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="" End With End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drop Downs | Suray1911 | Excel | 1 | 09-29-2015 10:31 PM |
![]() |
MicrosoftNovice2015 | Excel | 1 | 09-15-2015 02:16 PM |
![]() |
rbd50 | Mail Merge | 3 | 03-31-2015 09:52 PM |
![]() |
Andrew H | Word VBA | 15 | 11-16-2012 08:34 AM |
![]() |
mhays | Excel | 6 | 01-16-2012 09:29 AM |