Export Drop-Down List Items

G

Guest

Is there a way to export the contents of a Drop-Down List from a Word Form
Document to use in another application? For example I have a drop-down list
called PartNumber. The PartNumber contains 25 items for the user to select.
How can I get all 25 items exported out to a file so that I can use in
another application.

I have a lot of Drop-Down List in this Word form and would like to be able
to export all the contents of these Drop-Down List from this form.

THANKS!!
 
D

Doug Robbins - Word MVP

Run the following code in a macro on exit from one of the formfields in the
document:

Dim mydrop As FormField, i As Long
Dim target As Document, source As Document
Set source = ActiveDocument
Set target = Documents.Add
For Each mydrop In source.FormFields
If mydrop.Type = wdFieldFormDropDown Then
target.Range.InsertAfter "The entries for " & mydrop.Name & " are:"
& vbCr
For i = 1 To mydrop.DropDown.ListEntries.Count
target.Range.InsertAfter mydrop.DropDown.ListEntries(i).Name &
vbCr
Next i
End If
Next mydrop


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Joined
Mar 24, 2023
Messages
1
Reaction score
0
I found the easiest way is the following:
1) Open the drop down so you can see all the elements
2) Take a screenshot
3) Run the screenshot on an OCR
4) Done
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top