Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How do I set up a combobox on word?

59 views
Skip to first unread message

Jay Freedman

unread,
Nov 10, 2005, 12:27:26 AM11/10/05
to
On Wed, 9 Nov 2005 20:33:02 -0800, "omolano"
<omo...@discussions.microsoft.com> wrote:

>Im trying to create a form using the control box, but I don't know how to
>populate the comboBox in word.

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

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

0 new messages