Thanks Jay, but I guess I wasn't totally clear in my first post.
The client doensn't need just the selected value in the dropdown fields, he
would like to export all the possible options for each dropdown to an Excel
file. This form must have close to 50 different dropdowns and he's trying to
avoid having to manually enter all the options into Excel.
Thanks!
> >Client is using Excel 2003/Win XP. He received an 8 page Word form with many
> >dropdown boxes. He is looking for a way to extract the data from the
[quoted text clipped - 21 lines]
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.
Yes, that's possible. This macro will create a .csv file with one row for
each dropdown, containing the name of the dropdown and all the items in its
list. You can then open the .csv file in Excel. If you want the data in
columns instead of rows, Excel's Paste Special command can do that (check
the Transpose box in the dialog).
Sub ExtractDropdownData()
Const qt = """"
Dim strData As String
Dim ddff As FormField
Dim le As ListEntry
Dim outputFile As String
outputFile = Replace(ActiveDocument.FullName, ".doc", "_data.csv")
Open outputFile For Output As #1
For Each ddff In ActiveDocument.FormFields
If ddff.Type = wdFieldFormDropDown Then
strData = qt & ddff.Name & qt
For Each le In ddff.DropDown.ListEntries
strData = strData & "," & qt & le.Name & qt
Next
End If
Print #1, strData
Next
Close #1
End Sub

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> Thanks Jay, but I guess I wasn't totally clear in my first post.
> The client doensn't need just the selected value in the dropdown
[quoted text clipped - 30 lines]
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
maryj - 01 Aug 2007 16:32 GMT
Awesome!!!
Worked great!

Signature
maryj
> Yes, that's possible. This macro will create a .csv file with one row for
> each dropdown, containing the name of the dropdown and all the items in its
[quoted text clipped - 59 lines]
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.