View Single Post
 
Old 01-31-2019, 06:06 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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