Export Drop-Down List Items

  • Thread starter Thread starter Guest
  • Start date Start date
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!!
 
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
 
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
 
Back
Top