> On Sun, 21 Dec 2008 07:36:23 -0800, Joanne Christensen <Joanne
> Christensen[ at ]discussions.microsoft.com> wrote:
>
> >I am trying to create a macro that would take whatever text has been
> >highlighted in a Word Document by the user and then add it on the fly to a
> >list box on a modeless form. The part that I am having trouble is somehow
> >capturing the contents of the selected text so I can make mytext in the
> >ListBox1.AddItem (mytext) be the highlighted text. I am lost at the present
> >time trying to sort out using range and selection. If there is anyone who
> >could help me with me, I would really appreciate it. Thanks!
>
> The code you're looking for is
>
> mytext = Selection.Text
> ListBox1.AddItem mytext
>
> or, if you don't need to use the variable mytext for something else, simply use
>
> ListBox1.AddItem Selection.Text
>
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ:
http://word.mvps.org> Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
>