Word – How to add a combobox in Word

microsoft wordmicrosoft-office

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?

Best Answer

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/

Related Question