JGJP was telling us:
JGJP nous racontait que :
> Hi,
>
[quoted text clipped - 12 lines]
>
> Can you get me started?
Yes, but to avoid confusion and wasting time, are you writing about a
dropdown as in a form field from the Form Toolbar (so as to create a
document protected for forms), or are you referring to a dropdown on a
userform?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
JGJP - 11 Aug 2006 19:33 GMT
> Yes, but to avoid confusion and wasting time, are you writing about a
> dropdown as in a form field from the Form Toolbar (so as to create a
> document protected for forms), or are you referring to a dropdown on a
> userform?
Bonjour,
I am refering to a Combobox from the Control Toolbox.
A Form field would have worked nicely for me, except I can't protect
the document because I need to be able to insert files into the
document.
Merci,
Jeanne
Doug Robbins - Word MVP - 11 Aug 2006 21:21 GMT
Rather than the combo box from the Control Toolbar in the document itself,
use a combobox in a UserForm.
See the article "How to create a Userform" at:
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

Signature
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
>> Yes, but to avoid confusion and wasting time, are you writing about a
>> dropdown as in a form field from the Form Toolbar (so as to create a
[quoted text clipped - 12 lines]
>
> Jeanne
Hi Jgjp,
> I'm trying to create a document that allows the user to choose text in
> a drop down and fill that result elsewhere. (We do not want the drop
[quoted text clipped - 8 lines]
>
> Animal Chosen: RESULT
You are already able to populate the combobox, I take it?
Then you need to use either the Change or the LostFocus event. Change
will fire with everything that is typed (or deleted). LostFocus fires
when the user leaves the field - you need to be careful with that if
you're using GotFocus and LostFocus with any other controls.
The basic code would be
Dim doc as Word.document
Dim bkmName as String
Dim rng as Word.range
Set doc = ActiveDocument
bkmName = "xyz"
If doc.Bookmarks.Exists(bkmName) Then
Set rng = doc.Bookmarks(bkmName)
rng.Text = combobox1.Text
doc.Bookmarks.add bkmName, rng
End IF
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
JGJP - 12 Aug 2006 10:59 GMT
> Then you need to use either the Change or the LostFocus event. Change
> will fire with everything that is typed (or deleted). LostFocus fires
[quoted text clipped - 18 lines]
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
Great! I'll give that a try. Yes, I do know how to populate the combo
box.
Thanks!