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.

Paste text, but having it remain highlighted at the target location.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
asrisl - 06 Mar 2005 14:19 GMT
   I need to copy a block of formatted text from one document to another.

   Immediately after the paste, I need to adjust the selection depending
upon certain conditions.

   So I need the selection to come into the new document 'highlighted' (and
retain its formatting). A normal copy/paste operation collapses the
insertion point to the end.

    Can I do what I want?

Ed
Jonathan West - 06 Mar 2005 14:27 GMT
>    I need to copy a block of formatted text from one document to another.
>
[quoted text clipped - 9 lines]
>
> Ed

This will do the needful

Sub PasteAndHighlight()
Dim iStart As Long
iStart = Selection.Start
Selection.Paste
Selection.Start = iStart
End Sub

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.