Using ComboBox Control

D

Duncs

I'm not sure if this is the right place to ask this, so please point me
in the right direction if not.

In keeping with my employers "best practice" procedures etc., we are
converting a number of Excel s/s to Word documents, for some reason.
One such s/s is a performance sheet, which allows people to mark each
employee out of 6 potential scores, over ten questions. Each question
can have a score of 1 to 5 and also 0, for not applicable. These are
shown as:

"1 - Significantly above"
"2 - Above"
etc.

I'm looking at Word and trying to determine how these values can be put
into the ComboBoxes. In Excel, it was done via the ListFillRange &
LinkedCell properties. However, I can't see how to do it in Word.

Can someone please help?

Duncs
 
D

Doug Robbins - Word MVP

What sort of form are you talking about?

If it is a protected document with a DropDown type formfield, then you add
the items via the Properties dialog of the formfield before the document is
protected.

If it is a UserForm with a ComboBox on it, then you can use the following in
the UserForm initialize event to populate the combobox

With ComboBox1
.AddItem "1 - Significantly above"
.AddUtem "2 - Above"
etc.
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Duncs

Doug,

Thanks for getting back to me.

Currently, what happens is, the employee sends the form out to all
those people that they have interacted / worked with. The form has ten
questions on it relating to the employee, and the person filling it in
picks a value from a drop-down list in the spreadsheet. This value can
range from 1 -> 5, or can be 0 for not applicable.

At the end of the sheet, there is another drop-down for the appraiser
to provide an overall score for the employee, again using the 1 -> 5
scale.

After this, there is an area where the appraiser cna enter text
relating to the employee, providing points of praise and / or areas for
improvement.

What I now need to do, is transfer this to a word document.

You mention adding the items via the Properties dialog. When I bring
this up, I can't see an entry similar to the "List Fill Range" in
Excel, or indeed any other way to enter the six entries I need in the
Combo.

I don't think I want to go down the avenue of creating a UserForm and
would much rather prefer to simply have a plain, simple word document,
with some text & some ComboBoxes in it.

TIA

Duncs
 
D

Doctorjones_md

Duncs,

Doug can sometimes talk over our heads ;)

Try this:

1. Create a Word.dot -- name is (for example) Performance.doc

2. Go to View in the Menu Bar and click on Toolbars and select Control
Toolbox so you can add objects to your document.

3. Press Alt+F11 to open Visual Basic Editor (VBE)

4. Select Performance in the Projects Window >>> Insert from the Menu Bar
and select UserForm (it will be named UserForm1 by default)

5. double-click this form and it will open on the right

6. Add a ComboBox1 to your form, and a CommandButton1
a. in the properties window, change the Name to:
cbxPerformance (for ComboBox1)

7. double-click the form on the right and the code window will show

8. You will see a UserForm1_Click() entry (shown below)
Private Sub UserForm_Click()

End Sub

9. Change the first line to read Private Sub UserForm_Initialize()

10. Then between the 1st line and the End Sub line, add the following:
With Me.cbxPerformance
.AddItem "1 - Significantly above"
.AddUtem "2 - Above"
etc.
End With


This should get you started -- HTH :)
 
D

Doug Robbins - Word MVP

See "Please Fill Out This Form"

Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

This suggestion is almost certainly not appropriate for a form that is to be
sent out to multiple responders as, if the receiver has the macro security
level set to high, the macros in the document will be deleted without any
indication of that being the case; if the macro security level is set to
medium. the user will be presented warning that the document contains macros
and they can make a choice of whether to enable them or not. If they choose
not to enable them, the form will not work.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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