

- #Microsoft word content control fields format color how to#
- #Microsoft word content control fields format color code#
- #Microsoft word content control fields format color series#
Note: In the above code, Statusis the title name when you creating the drop down list, and Complete, In Progress, Not Start are the items of the drop down list, you can change them to your own. Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic Cells(1).Shading.BackgroundPatternColor = wdColorBlue Cells(1).Shading.BackgroundPatternColor = wdColorGreen Cells(1).Shading.BackgroundPatternColor = wdColorRed VBA code: Insert color coded drop down list into table of a Word document: Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
#Microsoft word content control fields format color code#
In the Microsoft Visual Basic for Applications window, double click ThisDocument from the Project-Project pane to open the mode, and then copy and paste the following code into the blank module. Then you should apply a VBA code, please hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.ħ. After creating the first drop down list, you can copy and paste it to other cells as you need. Repeat the Step 3 to insert other drop down list items as you need.ĥ. (3.) In the Add Choice dialog, type the drop down list item into the Display Name text box.Ĥ. (2.) Click Add button go to the Add Choice dialog (1.) Enter the title name into the Title text box In the Content Control Properties dialog box, please do the following operations: The drop down is inserted into the specific cell, and then click Developer > Properties, see screenshot:ģ. Select a cell in the table where you want to insert the drop down, and then click Developer > Drop-Down List Content Control icon, see screenshot:Ģ. The following steps can help you to finish this task as you need, first, insert the drop down list, and then apply the color for the drop down. Insert color coded drop down list in Word document with VBA code How could you solve this job in Word document?

It means when I select one option from the drop down, the cell color becomes red, and when I select another option in the drop down, the cell color becomes green as following screenshot shown. Supposing, I have a table in my Word document, and now, I want to insert color coded drop down list in a column of the table.
#Microsoft word content control fields format color how to#
No-one needs to 'learn' how to use the macro.How to insert color coded drop down list in Word table? If you get a prompt about not being able to save with the macro in a dotx template, click 'No' and, at the 'SaveAs' prompt that appears, choose the 'Word Macro-enabled Template (dotm)' type, then Save.įrom now on, if you used the newly-saved dotm template, the only change in behaviour you'll see is that any content control other than a Check Box or Picture content control will have yellow shading until something other than the placeholder text is displayed. You'll be prompted to save your template changes. Copy & paste the code from my post above into the 'ThisDocument' module.ĩ. Double-click on the 'ThisDocument' module to open it.ħ. Click on your template and drill down to the 'ThisDocument' module.Ħ.
#Microsoft word content control fields format color series#
On the left-hand side of the screen you'll see a series of 'projects', one of which is your template.ĥ. That includes color, bold, italic, super/subscript, etc.

Yes, applying direct formatting (formatting that is not part of the applied style) will override whatever style was applied, and it will affect both the placeholder text and any entered text.

Delete any existing content control shading.Ĥ. The Properties dialog opens with the applied style already selected in the Style list.
