Text Insertion

R

Robin

Hello,
Im very much a beginer in all this and have probably
chosen a difficult thing to do for my first time but here
goes.
I have a drop down field used in a protected form with a
list of various subjects. What I would like to happen is
that once the subject has been selected for some text
regarding that subject to automatically fill out on the
rest of the document to explain about the subject... any
idea or desparate help needed...
Thanks :eek:)
 
L

Laurent

in
microsoft.public.word.vba.beginners
Hello,
Im very much a beginer in all this and have probably
chosen a difficult thing to do for my first time but here
goes.
I have a drop down field used in a protected form with a
list of various subjects. What I would like to happen is
that once the subject has been selected for some text
regarding that subject to automatically fill out on the
rest of the document to explain about the subject... any
idea or desparate help needed...
Thanks :eek:)

combobox1_change()

select case combobox1.listindex
case 0
selection.type "Hello World"
case 1
case 2
...
end select

end sub

or such thing.

isn't it ?
 
R

Robin

It could well be that but I've never done anything like
this before so dont really know where to start guess I
need a book or something...!
 
D

Doug Robbins - Word MVP

Hi Robin,

If you create autotext entries that explain the subject with each autotext
entry having the name that will appear in the dropdown list, then if you run
a macro containing the following code on exit from the dropdown field, it
will display the explanation in the formfield with the bookmark name "Text1"

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name
'
Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown
Company = myDrop.ListEntries(myDrop.Value).Name
Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value
ActiveDocument.FormFields("Text1").Result = Address

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
L

Laurent

in
microsoft.public.word.vba.beginners
That would work on a userform, but not a document using formfields
like the one that Robin is talking about.

Sorry, you're totally right.
 

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