Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

How to find all the selections

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Inbar - 24 Feb 2005 21:57 GMT
If I'm using ActiveWindow.Selection to get a selection, I only get the last
selection that was made by the user. If the user selected 2 or more parts of
the document - how do I get the rest of them?

Thanks!

Inbar.
Jonathan West - 24 Feb 2005 22:41 GMT
> If I'm using ActiveWindow.Selection to get a selection, I only get the
> last
> selection that was made by the user. If the user selected 2 or more parts
> of
> the document - how do I get the rest of them?

As far as I know, you can't. VBA doesn't provide access to the multiple
selections.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jay Freedman - 24 Feb 2005 23:24 GMT
>> If I'm using ActiveWindow.Selection to get a selection, I only get the
>> last
[quoted text clipped - 4 lines]
>As far as I know, you can't. VBA doesn't provide access to the multiple
>selections.

See http://support.microsoft.com/?kbid=288424 for Microsoft's advice
on this subject.

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
Klaus Linke - 25 Feb 2005 18:53 GMT
You might apply some formatting that's unlikely to be used (finally a use for "marching ants" text effects?), and then use "Find" to loop all ranges that have that formatting applied, removing it in the process.

Klaus

> >> If I'm using ActiveWindow.Selection to get a selection, I only get the
> >> last
[quoted text clipped - 4 lines]
> >As far as I know, you can't. VBA doesn't provide access to the multiple
> >selections.

> See http://support.microsoft.com/?kbid=288424 for Microsoft's advice
> on this subject.
[quoted text clipped - 3 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org
Inbar - 09 Mar 2005 19:11 GMT
Klaus,
OK, let's assume I do that. I run "Find" and then what? How to I get all the
"range" objects for everything that was found? I don't really see how this
helps me. I will still have a multiple selection that I cannot use...

> You might apply some formatting that's unlikely to be used (finally a use for "marching ants" text effects?), and then use "Find" to loop all ranges that have that formatting applied, removing it in the process.
>
[quoted text clipped - 16 lines]
> > Jay Freedman
> > Microsoft Word MVP         FAQ: http://word.mvps.org
Jonathan West - 10 Mar 2005 00:22 GMT
> Klaus,
> OK, let's assume I do that. I run "Find" and then what? How to I get all
> the
> "range" objects for everything that was found? I don't really see how this
> helps me. I will still have a multiple selection that I cannot use...

if you apply the Marching Red Ants character format to the Selection, it
does in fact apply it to all areas of a multiple selection.

You can then do a Find, searching for examples of Marching Red Ants, adding
each area found to an array or collection of Range objects, removing the Red
Ants format in the process

You can then maniplate those ranges in any way you want.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.