Combobox not working in 2000, please help :-(

G

gravesen

HI I have a couple of comboboxes in a document. Theese are for exampl
to choose between who the letter is for. In the combobox you can choos
between, Dear sir, Dear madam and so on. The combobox works fine if
open i through word as a template but I would like to open this by jus
dobbelt clicking and opening as a doc file. When I try opening as a do
file my comboboxes does not work they are just emty. I have tryed it o
a office 2003 and here it works fine. Can anyone help me with what I a
doing wrong. I have placed the following code in ThisDocument:

First I have this for each of the comboboxes:
Private Sub ComboBox1_Change()

End Sub

And then this one:
Private Sub Document_Open()
Dim vColor, vColors
vColors = Array("For the attention of the Managing Director", "Fo
the attention of the Purchasing Manager", "For the attention of th
Branch Manager")

For Each vColor In vColors
ComboBox1.AddItem vColor
Next
ComboBox1.ListIndex = 0
ComboBox1.AutoSize = False

Dim fColor, fColors
fColors = Array("Dear Sir", "Dear Madam", "Dear Mr Jones", "Dea
Sirs", "Dear Mesdames")

For Each fColor In fColors
ComboBox2.AddItem fColor
Next
ComboBox2.ListIndex = 0
ComboBox2.AutoSize = False

Dim gColor, gColors
gColors = Array("Yours faithfully", "Yours sincerely")

For Each gColor In gColors
ComboBox3.AddItem gColor
Next
ComboBox3.ListIndex = 0
ComboBox3.AutoSize = False

End Sub


Thanks
Lars Gravese
 
S

Suzanne S. Barnhill

If you have saved these macros in the document template, then you need to be
creating a new document from the template in order to use them. You can
include an AutoNew macro to show your UserForm. When you double-click on a
..dot file, the default action is New, so you should be able to do this from
the desktop or Windows Explorer as well as from Word's File New dialog.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top