Is there a VBA command for "delete to the end of this document"?
Thanks.
Anne Troy - 24 Oct 2005 20:33 GMT
I recorded this, Rick:
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
There's probably a more eloquent way of doing it.
************
Anne Troy
www.OfficeArticles.com
> Is there a VBA command for "delete to the end of this document"?
> Thanks.
Tony Jollans - 24 Oct 2005 20:35 GMT
Not, AFAIK, an explicit single command but this should do it:
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.Delete
--
Enjoy,
Tony
> Is there a VBA command for "delete to the end of this document"?
> Thanks.
Doug Robbins - Word MVP - 24 Oct 2005 20:38 GMT
Dim myrange as Range
Set myrange=Selection.Range
myrange.End = ActiveDocument.Range.End
myrange.Delete

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Is there a VBA command for "delete to the end of this document"?
> Thanks.