

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) 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 insert code block how to#
How to insert color coded drop down list in Word table?
