Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I add a combobox in a word document without creating a form? Is there a possible way? I've seen comboboxes in Excel, is it possible in word?

share|improve this question
    
What are you trying to accomplish? Word "fields" could be what you're after – RJFalconer Jun 1 '10 at 18:18
    
I have a table in a word document with all its values based on one colour, however this has to be done for 8 colors. Instead repeating myself, I want something that will change values when a color is picked. – John Jun 1 '10 at 18:22

You have to write VBA (macro) code in the Document_New and Document_Open procedures.

The simplest method, if the contents of the list will always be the same, is to use something like

Private Sub Document_New()
With ComboBox1
.AddItem "one"
.AddItem "two"
' etc.
.ListIndex = 0
End With
End Sub

You'd need the same thing in Document_Open, because the combo box doesn't store the list in the document file when the document is closed.

If you need to get values from a database, see the combo box part of the article at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwor...2/html/

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .