First, I'm assuming that you have a combo box from the Control Toolbox
and not the dropdown from the Forms toolbar -- they're completely
different. The Forms dropdown doesn't require any programming
(although you can use a macro to set one up, it isn't necessary).
You need to make a template for your document. In the template, you
have to write macros in the ThisDocument module named Document_New
(which runs automatically when a document is created from the
template) and Document_Open (which runs automatically when an existing
document based on the template is re-opened). In each of those macros,
you need code to add items to the combo box's list. It could look
something like this:
Private Sub Document_New()
Populate ComboBox1
End Sub
Private Sub Document_Open()
Populate ComboBox1
End Sub
Sub Populate(cbo As MSForms.ComboBox)
With cbo
.AddItem "one"
.AddItem "two"
.AddItem "three"
.ListIndex = 0
End With
End Sub
Of course, you would replace the items in parentheses with the text
you want in the list. You can add as many as you want. Also, it's a
good idea to replace the default name of the combo box (ComboBox1)
with something that reflects what the list is used for.
A more complex method, but better for large amounts of data, is shown
at
<
http://msdn2.microsoft.com/en-us/library/aa140269(office.10).aspx>.