#1
|
|||
|
|||
How to delete all but specific words in Microsoft Word document
I am trying to delete everything in a very large Microsoft Word document except every instance of the term "NAYS:" or "nay" until then next line break. Is this possible? I am basically coding-illiterate--apologies in advance.
Thanks! |
#2
|
||||
|
||||
It's not clear why you'd want "NAYS:" or "nay" rather than "NAYS:" or "nays:". Try:
1. Mark the whole document as hidden text. 2. Use a wildcard Find/Replace where: Find = [Nn][Aa][Yy]*^13 Replace = ^& and the replacement font is set to not hidden. 3. Use an ordinary Find/Replace to Find all hidden text and replace it with nothing. Note that this Find all lines with "NAY" or "nay"; it's not limited to lines with "NAYS:" or "nay". Alternatively, if it really must be "NAYS:" or "nay", try: 1. Mark the whole document as hidden text. 2. Use a wildcard Find/Replace where: Find = NAYS:*^13 Replace = ^& and the replacement font is set to not hidden. 3. Use a wildcard Find/Replace where: Find = nay*^13 Replace = ^& and the replacement font is set to not hidden. 4. Use an ordinary Find/Replace to Find all hidden text and replace it with nothing.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I had to log in just to say this solution is brilliant!
|
#4
|
||||
|
||||
Cross-posted at: https://stackoverflow.com/questions/...-word-document
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
delete, find & replace, macro |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to search for specific words in a document | mike0215 | Word VBA | 2 | 11-28-2017 07:25 AM |
Wanting to use checkboxes etc in a TOC to delete specific pages in a 300 page document | Tammy | Word | 4 | 10-11-2016 05:53 PM |
Highlight duplicate words.. ?? IN MICROSOFT WORD !! | Abhi | Word | 1 | 09-22-2016 07:25 PM |
VBA Word - Find & Apply Styles to Specific Words - Using Case Statement | jc491 | Word VBA | 17 | 12-26-2015 12:25 PM |
Delete specific mass text on document | JadeRisley | Word | 4 | 07-17-2013 11:11 PM |