?
Solved

Getting combobox to display values in a form in Word 2003

Posted on 2008-06-12
4
Medium Priority
?
552 Views
Last Modified: 2013-12-26
Ok, this one should be simple, I know, but I just cannot figure it out.

I have a form in Word 2003 which has a couple of combo boxes on it. I want these combo boxes to have a list of values for the user to select from. This list is static and doesn't need to be pulled from elsewhere.

How on earth do I get the list of values into the combo box?

One is called "DocType" and the other "Category". I have tried code like this:

With Me.Category
        .AddItem ("Bible")
etc

and it doesn't work, no error, just no values.

If I can get this working I'll be very happy :)

Thanks
0
Comment
Question by:chuckalicious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Flyster
ID: 21768882
Does it have to be through VBA? If you right-click your combo box and select properties, you'll get the Drop-Down Form Field Options dialog box. Enter your item in the Drop-Down item box and select "Add". This will add it to your combo box.

Flyster
0
 
LVL 4

Author Comment

by:chuckalicious
ID: 21768935
I do not get any "Add" option.

To make sure we're on the right track here, I have a macro in Word 2003 which uses a form, also created via the MS VB editor in Word. When I right click on the ComboBox, I get a long list of properties/options, but none which give any kind of Add option....

And no, it doesn't need to be done programatically, I just want the values in the fields :)
0
 
LVL 22

Accepted Solution

by:
Flyster earned 500 total points
ID: 21778422
Sorry for the delay, I have only one computer with 2003. The dialog box i described above was obtained from right-clicking the combo box on the form. I can't seem to find what you're getting. You should be able to populate those box during your open event. Try this code:

Sub BoxList()
With ActiveDocument.DocType
.Clear
.AddItem "Doc1"
.AddItem "Doc2"
.AddItem "Doc3"
End With

With ActiveDocument.Category
.Clear
.AddItem "Cat1"
.AddItem "Cat2"
.AddItem "Cat3
End With

End Sub

Hope it works for you.
0
 
LVL 4

Author Closing Comment

by:chuckalicious
ID: 31466482
See!! I knew it was something simple!!

I was using this same code, however I had it in the initialise of the form, instead of the enter event of the dropdown!

Works perfectly, thank you :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question