Hi =?Utf-8?B?dG9ueUJydWNrbmVy?=,
Since Word is not Excel it's fairly logical that an Excel tool
(RefEdit) won't work in Word. Unfortunately, you don't tell us which
VERSION of Word/Office you need to work with. Generally, I'd say you
need to make the UserForm non-modal (only works in Office 2000 and
later) so that you can select the text in Word. Then the user needs to
click a button on the form so that VBA code will pick up the
selection.
Note that macro questions should be directed to one of the word.vba
newsgroup. In your case, probably .beginners
How do I write a macro that will allow me to select a string in the
Word document, assign this string to a variable, and then continue to
End Sub? The RefEdit control does this in Excel...the userform is
equipped with a RefEdit and a command button. I am able to click a
cell, which reads-in the contents into the RefEdit box. The command
button is then clicked, which moves the program through its
subroutines, assigning the sring to a variable and doing the required
task with it. I cannot get the RefEdit box to do this for me in Word.
I am not allowed to click on the document while the userform is
visible.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)