Skrollan30 0 Newbie Poster

Hi,

I hope some one have time to help a new hobby programme.

I have a Word doc with is a report over an inspection, with is linked to VBA.

First history
When you are open the doc you will have a pop up window (with is create in VBA)
were you can fill in a lot of information in a textbox. The textbox is linked with a bookmark in the doc and named in VBA with same name. Here everything is working perfect.

But I also need to create some comboboxes, how should I do so it will work right?
The first I have done is to create the box and name it in VBA and in word.
I have write this code:

Private Sub UserForm_Initialize()
LoopControls IniDataForm.Controls

'cmb Weather
Weather.AddItem "Dimma"
Weather.AddItem "Duggregn"
Weather.AddItem "Hagel"
Weather.AddItem "Halvklart"
End sub

How should I write cmb to point/ fill in the field in the doc?
The bookmark in Weather.

Thanks for all you helps.

Best regards
Maria

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.