Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

How do I populate a combo box in microsoft office word 2003?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ashley.odonnell@gmail.com - 13 Jun 2007 15:44 GMT
I am trying to create a form in word 2003 and I need an application
where I can select more than one answer for a question.  I therefore
am trying to create a combo box but I have no idea how to populate
it.  I have tried entering the options that I want in the combo box in
the 'value' field but i only succeed in having one line.

Any suggestions???
Jonathan West - 13 Jun 2007 16:07 GMT
>I am trying to create a form in word 2003 and I need an application
> where I can select more than one answer for a question.  I therefore
[quoted text clipped - 3 lines]
>
> Any suggestions???

Me.ComboBox1.List = Split("Apple|Orange|Banana|Grape|Pomegranate|Mango",
"|")

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

ashley.odonnell@gmail.com - 13 Jun 2007 16:29 GMT
> <ashley.odonn...@gmail.com> wrote in message
>
[quoted text clipped - 16 lines]
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petitionwww.classicvb.org

Sorry Jonathan,
But do I enter this in the value field in the properties menu?
Jonathan West - 13 Jun 2007 16:52 GMT
>> <ashley.odonn...@gmail.com> wrote in message
>>
[quoted text clipped - 19 lines]
> Sorry Jonathan,
> But do I enter this in the value field in the properties menu?

Sorry, should have been clearer. You include it as a line of code in the
UserForm_Initialize event.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

ashley.odonnell@gmail.com - 13 Jun 2007 17:07 GMT
> <ashley.odonn...@gmail.com> wrote in message
>
[quoted text clipped - 34 lines]
>
> - Show quoted text -

Jonathan,
I feel really ridiculous, but this is what i did and it did not
work....

I went to view code, then insert userform, and then i right clicked on
the grey box that appeared and went into view code and pasted the code
you gave me above in this field....it didn't work....
I'm really sorry, I have never used forms before!
Jonathan West - 13 Jun 2007 18:20 GMT
> Jonathan,
> I feel really ridiculous, but this is what i did and it did not
[quoted text clipped - 4 lines]
> you gave me above in this field....it didn't work....
> I'm really sorry, I have never used forms before!

Proceed as follows

1. insert your userform.
2. Create your combobox on the userform (call it ComboBox1 for now)
3. right-click somewhere on the form (not on the combobox) and click "View
code"
4. you will see the cursor positioned in its own line immediately below
"Private Sub UserForm_Click()". Change "UserForm_Click" to
"Userform_Initialize" (note the spelling - make sure you use the z).
5. Insert my line of code immediately after.
6. Press F5 to run the userform. Click the button on the right of the
combobox to display the dropdown list.

For more on creating UserForms, take a look here

How to create a Userform
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

ashley.odonnell@gmail.com - 14 Jun 2007 14:00 GMT
> > Jonathan,
> > I feel really ridiculous, but this is what i did and it did not
[quoted text clipped - 27 lines]
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petitionwww.classicvb.org

Thank you so much Jonathan.  It works beautifully!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.