Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word drop down form field.. neeed list of items

Status
Not open for further replies.

MINIBB

Technical User
Jan 18, 2004
3
US
I am going CRAZY. I have a form with a drop down that provides 25 choices.. I want to grab a copy of my 25 choices to put into a word or excel doc to modify..or make notes next to. I've looked every where and I'm stumped. The "properties" just brings up ANOTHER dialogue box.. but no where does it give me the option to copy and paste my 25 choices to clipboard. I know that this must be stored with this document somewhere.. any help would be very appreciated.
 
Hi,
If I understand you, you want to go into the field options and copy the list of choices. Unlock the form on the Forms toolbar, double-click on the field itself and that should display the options dialog box with the list.


Best,
Kathy [2thumbsup]
BlueHorizon
 
Here is a subroutine that will display the lists from all drop down fields in the document. You can easily change it to paste each list into a document, or where ever.

Sub GetDDList()
Dim le As ListEntry
Dim strList As String
Dim myField As FormField
Dim i As Integer
i = 1
On Error Resume Next
For Each myField In ActiveDocument.FormFields()
If myField.Type = wdFieldFormDropDown Then
For Each le In _
ActiveDocument.FormFields(i).DropDown.ListEntries
strList = strList & le.name & vbCrLf
Next le
' do whatever you want with the
' the string of the list. This simply
' displays each list.
' if you want to clear off the
' list string for the next dropdown
' make sure to reset strList to ""
MsgBox ActiveDocument.FormFields(i).name & _
vbCrLf & strList
strList = ""
Else
End If
i = i + 1
Next myField
End Sub
 
Thanks so much for the assistance; I'm still not getting this to work:

When I double-click the field.. it does bring up a properties box that shows the 25 list items.. but I cannot select more than one to copy to the clipboard.

I used the subroutine suggested in the second post and got a word msg box with a list of items; now I need to be able to copy the list of items from the message box; but it will not allow me to highlight them. My VB is rusty and lacking..so I could not figure out how to say.. list the items in the word doc.

I'm still not understanding where the drop down list values are stored in the word doc form. I would THINK that I could go into the VB and find where they put in the "displayvalue" info.. but have not found that.

God Bless & thanks for helping
 
Uh, the routine I wrote just displayed the list. The list itself is a string. As I noted in the comments, you can do whatever you want with the string. I simply displyed it in the message box.

You can not copy anything from a message box. It is a message box. The string itself still exits. If you want to copy and paste that string somewhere else, then you can do so.

the following changes displaying the list in a message box, to making a new document and putting the list there. But again, it is a string, you can put it anywhere you like.

----- previous code ---------
If myField.Type = wdFieldFormDropDown Then
For Each le In _
ActiveDocument.FormFields(i).DropDown.ListEntries
strList = strList & le.Name & vbCrLf
Next le
'comment - was previous displaying strList in message box
'comment - now creates new doc with the list

Documents.Add DocumentType:=wdNewBlankDocument
Options.ReplaceSelection = False
With Selection
.TypeText Text:=strList
.TypeParagraph
End With
----the rest of the code -------
 
You are an absolute GENIUS! I'm so amazed and appreciative. I was knocking myself out trying to figure this out. I am NOT a programmer and I'm shocked that Microsoft did not make this easier. I'll now be able to WOW those at work.. they said that it could NOT be done. I hate when people do not have a vision for what computers can do.

If you want to email me your address (p.o. box is fine). I'd love to send you a pizza gift certificate to show my gratitude. I'm assuming that you have dominos or some other chain where you live. My email address is beverlygodwin@comcast.net

Thanks so much for being so kind as to take your time to help me with this puzzling/aggravating problem. I'll sleep a LOT better tonight!

God Bless
 
Hello BlueHorizon....this is a different question, but related to this thread. I'm trying to copy a Word 2002 document that has several form fields in it, and place the formatted results into Excel...this worked fine with earlier Word. The drop-down selected values are NOT copying when I do this. Any idea how to copy, and get everything, including the drop down values, when I paste into Excel? Thanks for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top