![]() |
#10
|
|||
|
|||
![]()
Well, no errors -- seemed to run through without a hitch with one huge exception:
All content in the Word doc is gone. Not sure where it went. I forgot to mention this was also occurring with the previous runs.. ? Would it help to use something like this to have it dump the results into a new docx? (this was old code I used a long time ago to take something from one Word doc and dump it into a new doc) Code:
Sub CopyHighlightedTextToADifferentDoc() 'THIS FINDS HIGHLIGHTED TEXT AND PLACES A COPY OF IT ON A SEPARATE NEW DOCUMENT IN LIST FORM FOR REVIEW 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. |
Tags |
extract, parens |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract name and address. | donlincolnmsof | Word VBA | 1 | 11-10-2017 12:59 PM |
VBA code to extract strings | twozedz | Excel Programming | 1 | 05-15-2016 06:00 AM |
Extract tables as images | didijaba | Word VBA | 2 | 05-06-2014 06:14 PM |
Extract Photographs | The Gap | PowerPoint | 4 | 04-22-2010 07:00 AM |
Extract from String using Wildcard | whousedmy | Word | 0 | 05-21-2009 01:35 AM |