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

A

ashley.odonnell

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???
 
J

Jonathan West

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???

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


--
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
 
A

ashley.odonnell

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

--
Regards
Jonathan West - Word MVPwww.intelligentdocuments.co.uk
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?
 
A

ashley.odonnell

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

--
Regards
Jonathan West - Word MVPwww.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petitionwww.classicvb.org- Hide quoted text -

- 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!
 
J

Jonathan West

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!

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


--
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
 
A

ashley.odonnell

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 Userformhttp://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

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

Thank you so much Jonathan. It works beautifully!
 
S

Stan Molesky

Hello,
I created a combo box, but now every time I open it I have to run the VBA code. How can I avoid this?
Here is the code:
Private Sub ComboBox1_Change()
Me.ComboBox1.List = Split(" Option1 Option2 Option3")

End Sub

Stan



ashley.odonnel wrote:

Re: How do I populate a combo box in microsoft office word 2003?
14-Jun-07

Thank you so much Jonathan. It works beautifully!

Previous Posts In This Thread:

How do I populate a combo box in microsoft office word 2003?
I am trying to create a form in word 2003 and I need an applicatio
where I can select more than one answer for a question. I therefor
am trying to create a combo box but I have no idea how to populat
it. I have tried entering the options that I want in the combo box i
the 'value' field but i only succeed in having one line

Any suggestions???

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

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

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

Re: How do I populate a combo box in microsoft office word 2003?
Sorry Jonathan
But do I enter this in the value field in the properties menu?

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

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

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

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

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

I went to view code, then insert userform, and then i right clicked o
the grey box that appeared and went into view code and pasted the cod
you gave me above in this field....it didn't work...
I'm really sorry, I have never used forms before!

Proceed as follows1. insert your userform.2.
Proceed as follow

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 her

How to create a Userfor
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.ht

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

Re: How do I populate a combo box in microsoft office word 2003?
Thank you so much Jonathan. It works beautifully!


Submitted via EggHeadCafe - Software Developer Portal of Choice
Making Silverlight Emulate Synchronous Requests
http://www.eggheadcafe.com/tutorial...1-c5c717c9b184/making-silverlight-emulat.aspx
 
S

Stan Molesky

Hello,
I've created a combo box in word, but now everytime I open it, I have to run the VBA code. How can I avoid this action?

Here is the code:

Private Sub ComboBox1_Change()
Me.ComboBox1.List = Split(" Option1 Option2 Option3")

End Sub



ashley.odonnel wrote:

Re: How do I populate a combo box in microsoft office word 2003?
14-Jun-07

Thank you so much Jonathan. It works beautifully!

Previous Posts In This Thread:

How do I populate a combo box in microsoft office word 2003?
I am trying to create a form in word 2003 and I need an applicatio
where I can select more than one answer for a question. I therefor
am trying to create a combo box but I have no idea how to populat
it. I have tried entering the options that I want in the combo box i
the 'value' field but i only succeed in having one line

Any suggestions???

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

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

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

Re: How do I populate a combo box in microsoft office word 2003?
Sorry Jonathan
But do I enter this in the value field in the properties menu?

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

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

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

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

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

I went to view code, then insert userform, and then i right clicked o
the grey box that appeared and went into view code and pasted the cod
you gave me above in this field....it didn't work...
I'm really sorry, I have never used forms before!

Proceed as follows1. insert your userform.2.
Proceed as follow

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 her

How to create a Userfor
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.ht

--
Regard
Jonathan West - Word MV
www.intelligentdocuments.co.u
Please reply to the newsgrou
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

Re: How do I populate a combo box in microsoft office word 2003?
Thank you so much Jonathan. It works beautifully!

creating a combo box in word
Hello,
I created a combo box, but now every time I open it I have to run the VBA code. How can I avoid this?
Here is the code:
Private Sub ComboBox1_Change()
Me.ComboBox1.List = Split(" Option1 Option2 Option3")

End Sub

Stan


Submitted via EggHeadCafe - Software Developer Portal of Choice
SharePoint - Managing Unused or Archive sites automatically
http://www.eggheadcafe.com/tutorial...5b-a2a8deb60cad/sharepoint--managing-unu.aspx
 
F

Fumei2 via OfficeKB.com

Please clarify.

This is an ActiveX combobox, from the Controls toolbar, and it is IN the
document?

This is a combobox on a userform?

If it is a ActiveX combobox in the document, populate it from the the
Document_Open event in the ThisDocument code module.

Sub Document_Open()
ComboBox1.List = Split(" Option1 Option2 Option3")
End Sub

Every tim ethe documentis opened the control is populated.

Why do you have it in _Change?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top