In Word, I have created a UserForm with a listbox filled with contacts from Outlook. I would like to add a text box (or other likely control) to look up contacts in the list. That is, I would like it to simulate typing while the listbox has focus. So, in the text box, one would type “L” and the selection in the listbox would move to the first item in the list beginning with L. Then one would type “i” and the selection in the listbox would move to the first item beginning with “Li” and so on.
There are a few places in Office where you can do this — if you use the GetAddress method, it displays a dialog that allows you to type in a box while the selection bar in the listbox jumps to the name you are typing. I would like to simulate that.
Yes, I could just let the users type a name in a text box and click Find. Or I could let them move focus back to the list (heck, I could move focus back to the list for them). But a lookup is more user-friendly and consistent with what they will find elsewhere.
I’ve tried several ways (most promising and most erratic being SendKeys) and have not been able to resolve.
Does anyone have any ideas? Pleeeeze?
Thanks,
Kim