PDA

View Full Version : how to load of data to combobox



Tamgovb
02-10-2007, 05:27 AM
Hi all, I'm new here.


If someone can to say, that I know something about Visual Basic, it surely nobody can't saying, that I know something about VBA in MS Word. So, and this will be as the saint of truth.

Now I need in this all a some help. I want to ask.

I want a put an some controls of direct on the document of .doc. Among other things the ComboBox controls. However I not know how to load the list of items to a combobox? It's possible without additional of file with data. I want save in this document these changes and I want to print on my printer this document as Word.doc
I use to this standard tools from window my MSWord (Office 2000)

some example of code will be useful here for me

Thanks in advance

BTW: sorry for my English....I know, I know....

mdmackillop
02-10-2007, 05:44 AM
Hi Tamgocb
Welcome to VBAX
I'm not clear if you want a combo on the document or on a userform so this shows both
The code for the document combo is in the ThisDocument module. This also opens the userform which has its own initialise code.
Hope this is clear from the example

fumei
02-10-2007, 05:57 PM
Malcolm....a userform with NO commandbutton? Tsk tsk!

Tamgovb - to perhaps help out here.

You can have either formfields or ActiveX controls right in the document. They are very different.

A combobox formfield - a dropdown formfield normally has its items (what is listed in the dropdown) entered manually. They are set up. They CAN be populated by code. The document must be protected for forms in order for the dropdown to work.

ActiveX comboboxes are populated by code. You can see the demonstration of this with Malcolm's document. The ActiveX control is populated by code in the Document_Open event in the ThisDocument module.

Tamgovb
02-27-2007, 05:04 AM
Welcome:hi:

Thanks for you both.

@ mdmackillop: this is exactly this what I wanted :clap:

I have one additional question.

It's possible to make an some additional refreshing for objects on the document MS Word?
When I use VScroll to move my page, then very strongly it smears me controls which are drawn on a this document MS Word.
I use XP/Office 2000

Some help will be appreciate. Thanks in advance.
Tamgovb

lucas
02-27-2007, 08:54 AM
BTW: sorry for my English....I know, I know....
Hi Tamgovb,
No need to apologize for your English. You actually communicate your question much better than many who speak perfect English.


It's possible to make an some additional refreshing for objects on the document MS Word?
When I use VScroll to move my page, then very strongly it smears me controls which are drawn on a this document MS Word.

Can you place bookmarks in the page and use goto to navigate to the bookmarks rather than VScroll? Just a thought. Nav1 would be a bookmark in the document.
Selection.GoTo What:=wdGoToBookmark, Name:="Nav1"

Tamgovb
02-28-2007, 09:24 AM
Hi all:hi:

Thank you Luc for all, but:doh::help....hmm sorry, maybe I expressed a little an exactly
I'm not sure or you understand me well.......
I did mean about VScrolBar this from system which it's visible from right side of screen in open document MSWord rather - that is the vertical scrollbar.
however the all of objects like ComboBox, TextBox or OptionButton it's are draw already
these drawn objects smear during moving in top or in bottom of this document

Tamgovb

mail2bharath
03-02-2007, 10:08 AM
i also would like to join u people