Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-31-2019, 06:06 AM
macropod's Avatar
macropod macropod is offline Find several words in document, copy paragraph and create new document Windows 7 64bit Find several words in document, copy paragraph and create new document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by coolio2341 View Post
The script below will search for "1945" and will copy the paragraph that contains "1945" and insert into new document. How to make do the same but for several texts example 1945, 1946, 1947 etc
With your original code, if it's a series of such years, use:
.Text = "<194[5-7]>"
with:
.MatchWildcards = True
and delete:
.MatchCase = False
.MatchWholeWord = False


.MatchSoundsLike = False
.MatchAllWordForms = False
This will ensure your output is in the same order as in the original document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find several words in document, copy paragraph and create new document Find and highlight multiple words in MS Word document AtaLoss Word VBA 37 09-22-2021 12:04 PM
Find several words in document, copy paragraph and create new document Macro to search for a particular word, copy the entire paragraph to a new document Productivity Word VBA 2 10-25-2019 06:40 AM
Copy text to new document based on paragraph numbering mike.mm Word VBA 7 11-22-2016 06:14 AM
Find several words in document, copy paragraph and create new document How to select and copy to clipboard an entire document except for a paragraph and keep formatting TD_123 Word VBA 7 06-16-2015 03:30 PM
Find and highlight multiple words in a document flatop Word VBA 3 04-16-2014 10:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:09 AM.


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