G Guest Nov 10, 2005 #1 Im trying to create a form using the control box, but I don't know how to populate the comboBox in word.
Im trying to create a form using the control box, but I don't know how to populate the comboBox in word.
J Jay Freedman Nov 10, 2005 #2 Im trying to create a form using the control box, but I don't know how to populate the comboBox in word. Click to expand... 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/dnword2k2/html/odc_activeX.asp
Im trying to create a form using the control box, but I don't know how to populate the comboBox in word. Click to expand... 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/dnword2k2/html/odc_activeX.asp