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
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