![]() ![]() To add or change a fill texture, point to Texture, and then click the texture that you want. ![]() To customize the gradient, click More Gradients, and then choose the options that you want. To add or change a fill gradient, point to Gradient, and then click the gradient variation that you want. To add or change a fill picture, click Picture, locate the folder that contains the picture that you want to use, click the picture file, and then click Insert. You can vary the percentage of transparency from 0% (fully opaque, the default setting) to 100% (fully transparent). At the bottom of the Colors dialog box, move the Transparency slider, or enter a number in the box next to the slider. To adjust the transparency of the shape, click More Fill Colors. Custom colors and colors on the Standard tab do not update if you later change the document theme. To use a color that isn't one of the theme colors, click More Fill Colors, and then either click the color that you want on the Standard tab, or mix your own color on the Custom tab. To add or change a fill color, click the color you want. On the Format tab, in the Shape Styles group, click the arrow next to Shape Fill. To add the same fill to multiple shapes, click the first shape, and then press and hold Ctrl while you click the other shapes. Cells(1).Shading.To add a fill or effect, click your shape, click Format, click the arrow next to Shape Fill or Shape Effects, and select a color, gradient, texture, or effect.Ĭlick the shape that you want to fill. Cells(1).Shading.BackgroundPatternColor = wdColorOrange The complete code should be this:Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Hello, joni,If there are two or more tables of drop down lists, you just need to copy and paste the below code into the original code, and change the text reference to your need. If ContentControl.Title = "Corrective action for cd" Then Cells(1).Shading.BackgroundPatternColor = wdColorYellow If ContentControl.Title = "Corrective action" Then Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Could you please inform me what I have done wrong? I tried to create two color code drop down lists in one Word template, however, I get an error message saying 'Ambiguous name detected: Document_ContentControON EXIT. Then save and close the code window, now, when you select one item from the drop down list, its relative color will be filled with the cell, see screenshot: And you can also change the color to your need.Ĩ. 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) 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. How to insert color coded drop down list in Word table? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |