VBA to copy selected value of dropdown in Word Doc into specific Excel cell

user1771800 picture user1771800 · Oct 24, 2012 · Viewed 8k times · Source

I am trying to return the text from a dropdown box that is selected on a Word form.

The word doc is a survey that contains a form with several dropdown boxes. I want to copy the value that the survey respondent selected from each dropdown into specific cells in Excel.

I have tried things such as:

Activedocument.DropDowns("DropDown1").Value;
Activedocument.DropDowns("DropDown1").Text; 
Activedocument.DropDowns("DropDown1").SelectedValue; 
Activedocument.Shapes("DropDown1").Value etc etc.

Current applicable parts of my code:

Dim dd14 As FormFields
With ActiveDocument
Set dd14 = ActiveDocument.FormFields("Dropdown14").DropDown.Value
Cells(iRow + 1, "H") = dd14
End With

Answer

scott picture scott · Oct 24, 2012

To reference the value for a legacy form dropdown field to get the value (which is the index, not the text of the selected item) the code is:

  activedocument.FormFields("dropdown1").DropDown.value