In Microsoft word, I have a 3x3 table, a button, and a drop down list.
When I press the button, I want the last row of the first column to be filled with the selected drop down list item. Then, add a row to the table below it.
Currently, I can't even fill values into the table.
ActiveDocument.Tables(15).Rows.Last.Cells.Value = "Hello"
returns an error. What can I do?
I managed to select the last row. ActiveDocument.Tables(15).Rows.Last.Select
Now, I need to copy the current value from the drop down list. How do I do that?
Here is one way. It inserts the text after any existing text:
If you know the specific cell location you could also use:
References:
1) table-cell-method-word
2) dropdown-object-word
You can loop so see which form fields are present in the
Activedocument
and get their names as follows:If you double click on the drop down form control it will open a window where you can view the
Bookmark
name i.e. the current name for the drop down object.You can also associate a macro via this route (so could remove need for a button potentially)
Legacy form control: