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 / October 2007

Tip: Looking for answers? Try searching our database.

clear selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Beans - 30 Oct 2007 20:40 GMT
Could someone please help with the code on how to clear the current
selection.  Not delete the contents, simply un-highlight what is currently
selected.

Thanks
Chad
Tony Jollans - 30 Oct 2007 20:59 GMT
Selection.Collapse wdcollapseEnd

will do it, and leave the cursor (insertion point) at the end of the
selectiion

Selection.Collapse wdcollapseStart

will do the same, but leave the cursor (insertion point) at the start of the
selectiion

Signature

Enjoy,
Tony

> Could someone please help with the code on how to clear the current
> selection.  Not delete the contents, simply un-highlight what is currently
> selected.
>
> Thanks
> Chad
Jay Freedman - 30 Oct 2007 21:05 GMT
> Could someone please help with the code on how to clear the current
> selection.  Not delete the contents, simply un-highlight what is
> currently selected.
>
> Thanks
> Chad

Either

  Selection.Collapse Direction:=wdCollapseStart

or

  Selection.Collapse Direction:=wdCollapseEnd

depending on where you want the insertion point to land.

Signature

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.

 
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.