Solved

Getting combobox to display values in a form in Word 2003

Posted on 2008-06-12
4
537 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 125 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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