Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2018, 01:51 PM
Landhaus416 Landhaus416 is offline How to delete all but specific words in Microsoft Word document Windows 10 How to delete all but specific words in Microsoft Word document Office 2016
Novice
How to delete all but specific words in Microsoft Word document
 
Join Date: Sep 2018
Posts: 1
Landhaus416 is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 09-19-2018, 02:25 PM
macropod's Avatar
macropod macropod is offline How to delete all but specific words in Microsoft Word document Windows 7 64bit How to delete all but specific words in Microsoft Word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,448
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

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
[MS MVP - Word]
Reply With Quote
  #3  
Old 09-19-2018, 02:55 PM
ATPWordPro ATPWordPro is offline How to delete all but specific words in Microsoft Word document Windows 10 How to delete all but specific words in Microsoft Word document Office 2016
Novice
 
Join Date: Apr 2018
Location: Houston, TX
Posts: 3
ATPWordPro is on a distinguished road
Default

I had to log in just to say this solution is brilliant!
Reply With Quote
  #4  
Old 09-19-2018, 03:00 PM
macropod's Avatar
macropod macropod is offline How to delete all but specific words in Microsoft Word document Windows 7 64bit How to delete all but specific words in Microsoft Word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,448
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

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
[MS MVP - Word]
Reply With Quote
Reply

Tags
delete, find & replace, macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete all but specific words in Microsoft Word document 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
How to delete all but specific words in Microsoft Word document Delete specific mass text on document JadeRisley Word 4 07-17-2013 11:11 PM

Other Forums: Access Forums - Senior Forums

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


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