Prompt user to select text

K

Kirsten

I would like to press a button, have the form hide, be able to select text
on the screen to put in my textstring (or range), then do stuff with that
text.

I looked all through the help but I'm not finding much on selecting text on
the screen.
(But I can go to town on the tenth word in any given paragraph.) :)
 
J

Jonathan West

Kirsten said:
I would like to press a button, have the form hide, be able to select text
on the screen to put in my textstring (or range), then do stuff with that
text.

I looked all through the help but I'm not finding much on selecting text on
the screen.
(But I can go to town on the tenth word in any given paragraph.) :)

Hi Kirsten,

The trick of this is that in the macro that shows the userform, you have
aline of code something like this

myForm.Show vbModeless

The vbModeless parameter allows you to continue to select text etc while the
userform is displayed.

This way, you can display an instruction on the Userform to select some text
and then click a button. In the Click event for the button, you pick up the
text by reading the Selection.Text property
 
K

Kirsten

That worked like a charm! Thanks, Jonathan.

Jonathan West said:
Hi Kirsten,

The trick of this is that in the macro that shows the userform, you have
aline of code something like this

myForm.Show vbModeless

The vbModeless parameter allows you to continue to select text etc while the
userform is displayed.

This way, you can display an instruction on the Userform to select some text
and then click a button. In the Click event for the button, you pick up the
text by reading the Selection.Text property


--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
 

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