Allowing user to enter value for listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am messing around with listboxes in Word 200. Can take a listbox from the Form toolbar and set it so that the user can enter their own value, basically overriding the values provided by the list box.

Thanks in advance.
 
That would be a "Dropdown" formfield that you are talking about.

While you can run a macro like the following on exit from a textbox
formfield to add what was entered into that formfield to the list in the
dropdown formfield, you must be aware that every time the user exits the
textbox formfield, whatever is in that formfield will be added to the list:
and that may cause you a problem.

ActiveDocument.FormFields("DropDown1").DropDown.ListEntries.Add
ActiveDocument.FormFields("Text1").Result


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Alcide said:
Hello,

I am messing around with listboxes in Word 200. Can take a listbox from
the Form toolbar and set it so that the user can enter their own value,
basically overriding the values provided by the list box.
 
Another approach that I have employed at times is to include an entry in the
dropdown formfield called "Other". When the user selects that option and
exits the dropdown, the exit macro displays an InputBox to prompt the user
for a new entry, then adds it as an option in the dropdown field, and makes
it the selected option.

Regards,
Chad DeMeyer
 
Back
Top