Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 11-15-2017, 06:10 PM
ChrisOK ChrisOK is offline Extract Between the Parens Windows 7 64bit Extract Between the Parens Office 2016
Advanced Beginner
Extract Between the Parens
 
Join Date: Sep 2016
Posts: 54
ChrisOK is on a distinguished road
Default

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.
Reply With Quote
 

Tags
extract, parens



Similar Threads
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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:03 PM.


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