Word 2010 Extract Dropdown List

Hello,

 

I have a word document that has a few dropdown lists in it. There is one dropdown list that I am trying to extract the contents from it. The Word document is saved with a .docx extension. I am using Word 2010 on Windows 7.

 

I have come across several different VB Scripts, but nothing seems to work. I provided a link to a VB script that I found. In the code I did change the part where it says .doc to .docx. The file is generated, but when opening it up the file is always blank.

http://www.microsoft-word-answers.com/microsoft/Word-VBA/30435817/extract-text-from-form-dropdown-to-excel.aspx

 

Most of the scripts I am finding appear to be for Office versions 2003, which might be the issue. Other scripts also have part of the code in it saying “DropDown1” as in that is the properties name of the object, which I can never find the name of my dropdown that I am trying to extract from. The only thing I can think of is that these scripts are for if a user form was used, such as you bring up VB editor by pressin Alt + F11, then go to the Insert menu and click on UserForm. Here you can view the file name and properties of objects that are added, but I am not using this. I am strictly using the Word document itself.  If you add the Developer tab and click on the dropdown button, that is what I am using. I know I can go to properties of that dropdown by selecting it and clicking properties, but it doesn’t appear that is the name of the object either since I tried to put what is listed in the “Title” of the properties in the place of “DropDown1” in the code, but it doesn’t work.


Like I said, I tried several different scripts to get this to work and can’t seem to get anything to work. I don’t care if I use script or some other option, is there a way to extract the list of the dropdown and if so how?

 

Thanks for any help someone can provide,

 

Zerners

What type of dropdown is it?

 

Perhaps if you were to upload a copy of the document to a public folder on your Windows Live SkyDrive and the post a link to it back here, we could see exactly what it is that you are needing to deal with.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Doug,

 

Thanks for the response. I actually figured it out, by accident. It isn’t the cleanest way, but got it. I clicked on record macro and then used the arrow keys on the keyboard to move the cursor until I had the dropdown box selected. For some reason you can’t select the dropdown with the mouse when a macro is recording. Once I had the box selected by using the arrows I clicked on the properties in the toolbar. I then selected an item in the list, clicked on edit, canceled out of the properties box. As soon as I backed out from the properties the recording macro imported all of the lines/entries from the dropdown into the VB script. It was a little messy because there were duplicate entries, which there weren’t any duplicates in the dropdown, and it had another line of information text between each item. I copied the section into Excel, made a VB script to remove the duplicated and garbage entries. Presto, I had the data I needed.

 

Thanks again for the response though,

 

Zerners

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If your dropdown is a legacy form field, then you can get the bookmark name by opening the Properties dialog (double-click on the field) when the form is unprotected. You can change the bookmark name to something more meaningful. You can then use a REF field referencing the bookmark name to get the results of the field (the selection chosen).
Microsoft MVP (Word) since 1999
Fairhope, Alabama USA
http://ssbarnhill.com
http://wordfaqs.ssbarnhill.com
Screen shots captured with TechSmith's Snagit

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated February 25, 2025 Views 4,105 Applies to: