R
Robert
I have started what is (for me) an ambitious project and
am having trouble visualising a central Procedure.
Deceptively simple, the exact solution eludes me for the
moment. Can someone help with the coding, please?
Sub "RedWord" starts with the one-page Active Document
displayed. The user clicks once on a word. The word is
automatically selected and turned red. Clicks on further
words are made, with the mouse-click starting each new
loop. All the selected words remain red until replaced,
see below. Clicking again on a (now red) word causes it
to revert to its original color, so some sort of toggle
is needed here. (One must allow for a change of mind.)
Realistically we may have 15 - 18 red, single words in
the final displayed document. The sequence of loops ends
when the Return key is pressed.
Parallel with, or after, the above, I need to build up a
string of all the single words finally chosen. However,
the words must first be sorted alphabetically. They are
then joined in a string with a <sp>/<sp> separator
between each (but no separator before the first word or
after the last). In a later Sub this string will be
printed back into the doc, so how do I make it available
to that Sub? In the present Sub it is displayed in a
Message Box when the Return Key terminates the loops.
Finally, after the Message Box has gone, I need to
replace each of the "Redwords" in the text with a series
of underscore characters only partly dependent on the
length of the Redword, as follows:
If Redword is 4 charas long or less, 6 underscores;
If Redword is from 5 - 10 charas, 12 underscores;
If Redword is 11 or more charas, underscores = Length
of Redword + 2 . The underscores, when displayed, should
not be coloured.
I will be most grateful for any help. Thanks a lot.
am having trouble visualising a central Procedure.
Deceptively simple, the exact solution eludes me for the
moment. Can someone help with the coding, please?
Sub "RedWord" starts with the one-page Active Document
displayed. The user clicks once on a word. The word is
automatically selected and turned red. Clicks on further
words are made, with the mouse-click starting each new
loop. All the selected words remain red until replaced,
see below. Clicking again on a (now red) word causes it
to revert to its original color, so some sort of toggle
is needed here. (One must allow for a change of mind.)
Realistically we may have 15 - 18 red, single words in
the final displayed document. The sequence of loops ends
when the Return key is pressed.
Parallel with, or after, the above, I need to build up a
string of all the single words finally chosen. However,
the words must first be sorted alphabetically. They are
then joined in a string with a <sp>/<sp> separator
between each (but no separator before the first word or
after the last). In a later Sub this string will be
printed back into the doc, so how do I make it available
to that Sub? In the present Sub it is displayed in a
Message Box when the Return Key terminates the loops.
Finally, after the Message Box has gone, I need to
replace each of the "Redwords" in the text with a series
of underscore characters only partly dependent on the
length of the Redword, as follows:
If Redword is 4 charas long or less, 6 underscores;
If Redword is from 5 - 10 charas, 12 underscores;
If Redword is 11 or more charas, underscores = Length
of Redword + 2 . The underscores, when displayed, should
not be coloured.
I will be most grateful for any help. Thanks a lot.