Microsoft Office Forums Copy paste highlighted text to another doc

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2013, 01:37 PM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default Copy paste highlighted text to another doc

I am trying find/build a macro that can copy all my highlighted text in a word document and paste it to another document. Is this possible?
Reply With Quote
  #2  
Old 02-10-2013, 02:42 PM
OTPM OTPM is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
Are you looking to copy your highlighted text to a new blank document or an existing document?
If it is an existing document is to a specific location in that document?
Tony
Reply With Quote
  #3  
Old 02-10-2013, 02:53 PM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default

Hi Tony,

It will be posted to a new blank doc.
Reply With Quote
  #4  
Old 02-10-2013, 04:14 PM
fumei fumei is offline Copy paste highlighted text to another doc Windows 7 64bit Copy paste highlighted text to another doc Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

And by "highlighted", do you mean that you have selected text (highlighted); or do you mean non-selected text that has highlights
Reply With Quote
  #5  
Old 02-10-2013, 04:18 PM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default

The highlighted sentences are from using the yellow Highlighter feature from the menu on the homepage. It has a highlighter pen look to it.
Reply With Quote
  #6  
Old 02-10-2013, 11:18 PM
fumei fumei is offline Copy paste highlighted text to another doc Windows 7 64bit Copy paste highlighted text to another doc Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Code:
Sub CopyHighlightsToOtherDoc()
Dim ThisDoc As Document
Dim ThatDoc As Document
Dim r As Range
Set ThisDoc = ActiveDocument
Set r = ThisDoc.Range
Set ThatDoc = Documents.Add
With r.Find
   .Text = ""
   .Highlight = True
   Do While .Execute(Forward:=True) = True
      ThatDoc.Range.InsertAfter r.Text & vbCrLf
      r.Collapse 0
   Loop
End With
End Sub

All highlighted text in the ActiveDocument are copied (with an added paragraph mark to separate them) to a new document.
Reply With Quote
  #7  
Old 02-11-2013, 02:28 AM
macropod's Avatar
macropod macropod is offline Copy paste highlighted text to another doc Windows 7 64bit Copy paste highlighted text to another doc Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,577
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Cross-posted (and solved only 20 minutes after the last post by MSOffice1) at: http://www.excelforum.com/word-progr...html?p=3119500
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #8  
Old 02-11-2013, 06:33 AM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default

Thanks Fumei. I cant tell you how much I appreciate it : )
Reply With Quote
  #9  
Old 02-14-2013, 10:00 AM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default

Hello awesome Forums,
Obviously you can tell that I am new to this..ie this is my first post!

The reason I posted the question on this forum is b/c my question is related to MS Word and not MS Excel. I thought the other site was primary for Excel questions (hence the forum name) and would not receive an accurate response or any response at all...ie 2 different program sites. What I should of done was delete the question on the other site. Sorry for the confusion and I hope you understand. Have a great end of the week and weekend

Thx
Reply With Quote
  #10  
Old 07-18-2013, 10:35 AM
MSoffice1 MSoffice1 is offline Copy paste highlighted text to another doc Windows 7 32bit Copy paste highlighted text to another doc Office 2010 32bit
Novice
Copy paste highlighted text to another doc
 
Join Date: Feb 2013
Posts: 6
MSoffice1 is on a distinguished road
Default

Fumei,

Thank you again for the code you provided. Can you tweak this where it will copy and past rather than cut and paste to the other doc.

Thanks
Reply With Quote
  #11  
Old 09-16-2019, 02:30 AM
MaheshT MaheshT is offline Copy paste highlighted text to another doc Windows XP Copy paste highlighted text to another doc Office 2016
Novice
 
Join Date: Sep 2019
Posts: 1
MaheshT is on a distinguished road
Default

How can I add page number and section heading of the highlighted para along with highlighted para
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Text Twice to Paste into word Albundy Word 2 09-02-2016 12:59 PM
Copy paste highlighted text to another doc Find & selected paras with highlighted text & copy to clipboard marceepoo Word VBA 1 09-14-2012 08:20 PM
Copy paste highlighted text to another doc Table copy/paste suddenly text-only mjcoon Word Tables 20 04-28-2012 08:53 PM
Can't copy/cut and paste text in Word 2002 mmiller751 Word 0 04-17-2012 02:55 PM
Losing Text box data when copy and paste Spay Excel 0 03-15-2011 07:18 AM


All times are GMT -7. The time now is 02:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft