replace strings after dropdownselection

V

Vinnie

Hello all,

I have created a word document with several dropdownboxes on it.
when i select an item from a dropdownbox, the text is inserted into a
bookmark.
This all works fine, but now i have created a table on the last page of my
document where in column 1 i have a string (that corresponds with a piece of
text in one of the dropdowns) and in column 2 i have another string (which
comes in fact from a merge field, so it is different each time the document
is opened from a merge).

What i want to do is:
When i select an item from a dropdown, which has strings that are defined in
column 1 of my table, that they are automatically replace with the value that
is in column 2 of the corresponding row.

Could anybody point me out how to accomplish this ?

Thanks already for all responses.

Greetings,
Vincent
 
V

Vinnie

Hello,

Maybe i haven't explained my problem correctly.

i'll do it a bit more simplyfied.

- i open my word document
- on page 1 and two i have a number of dropdownboxes
- on the last page i have a table with 2 columns
(col1 = code, col2 = description)
example :
col1 col2
----------------------------------------------------------
<TR1> Mr
<TR2> Smith
<TR3> John
........

when in one of my dropdownboxes i have selected the following text:
Dear <TR1> <TR2>, we thank you for your trust in our company.

- when i select the above item, it is automatically inserted in a bookmark
just under the dropdown.

What i would like next in that automated step is that a script checks the
content of the that text and if it finds a value (like <TR1>) that is
contained in col1 of my table, automatically replaces it with the value that
is in col2.

So the script should run through all the <> values it finds in the selected
text from the dropdownbox and compare it with the values in col1 of my table.
when it finds the correspondant value, it should be replaced with the value
in col2.

I hope i didn't offend you with me reply, but i thought my question was not
clear enough.

thanks again for your help.

Vincent
 
G

Graham Mayor

What sort of drop down fields are these and in what Word version? Are you
able to send me a copy of your document (use the link on the home page of my
web site) so that I can see exactly what you are trying to do here?

P.S. I am not easily offended, but I can't see over your shoulder from here
:)
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
V

Vinnie

Hello Graham,

I work with word 2003.
The type of dropdown is a combobox element from the visual basic toolbar.

I have also sent you the word doc to your support address.

Thanks for the help already.
 
G

Graham Mayor

You must have sent it via the scenic route - as it has not arrived here.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

I take it that you are the same Vinnie that has a similar thread in this
forum, that Doug has been responding to? Based on the additional information
in that thread, I would agree with Doug that a userform is the way forward.
The ActiveX tools are really intended for web page use.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
V

Vinnie

Ok, so how do i start with that kind of document.
Does it means that the user will have a window (or form i think) when the
document opens (or accessiable by a button) and the actual word document.
and all interaction between the form and the document will be by code.

Do you have an example of such a document ?

In the meanwhile i have resent the document.

Thanks for the info.
 

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