Written by Allen Wyatt (last updated June 5, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Richard needs to search through a document and look for a period followed by a quote mark (."), but only if those two characters do not occur at the end of a paragraph. He figures this search can be done using wildcards, but he's not quite sure of the pattern to use in the search.
There are a couple of ways you can tackle this need. The first is to follow the brute-force method of using Find and Replace. Using multiple passes through the document, simply rename the item you don't want to change, change what's left, then rename the original back to whatever it was to start with. In the first of these three passes you would search for a period, quote mark, and paragraph mark, replacing it with something that doesn't occur in the document (such as the phrase 'parmark'). Then search for the period and quote mark combination and replace it with whatever you want. Finally, search for the phrase you used ('parmark') and replace it with a period, quote mark, and paragraph mark.
There is a huge drawback to this approach, though, and it is introduced because you are replacing paragraph marks. Remember that a paragraph mark contains the paragraph-related formatting for the paragraph that it ends. If you do away with a paragraph mark in the Find-and-Replace operation, then the paragraph becomes part of the following paragraph and loses any distinctiveness it had. Thus, if the ." combo ended a bulleted or numbered list paragraph, the Find and Replace "unformats" that paragraph and causes it to adopt the formatting of whatever paragraph follows it.
The solution is to, instead, use the second method, which involves doing a wildcard search. When you display the Replace tab of the Find and Replace dialog box, make sure the Use Wildcards check box is selected. (To see the check box, you'll need to click the More button if it is available.) In the Find What box, use this pattern:
.[""][!^13]
This pattern means you are searching for a period followed by a single character designated by whatever is in the first set of brackets. There are two characters there: a regular quote mark and a closing smart quote. (Wildcard searches make a distinction between normal quotes and smart quotes.) The closing smart quote is most easily entered by using copy and paste—copy it from someplace in your document and paste it into the pattern.
The second set of brackets in the pattern specify to find any character except the one noted. The character noted is a paragraph mark (^13) but adding the exclamation mark in front of it means don't match any paragraph marks.
There is an important caveat to mention here, and it has to do with the nature of the document you are searching. It is not uncommon to have "trailing spaces" at the end of paragraphs. Normally you wouldn't notice a stray space or two, as they don't really show up on the screen and they don't affect what may be printed. However, they will affect this particular wildcard search. The ." combo followed by a space or two and then a paragraph mark is much different than ." followed immediately by a paragraph mark. The wildcard search will match the former and ignore the latter, when you probably want it to match both.
The only way around this potential gottcha is to make sure that you get rid of any trailing spaces before your do the search for the ." combo. It is easiest to see if you have such trailing spaces in your document by turning on non-printing characters so they are visible. You can also do a regular Find and Replace, looking for a space followed by a paragraph mark and replacing it with a paragraph mark.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10096) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
Hate to take your hands off the keyboard? This tip explains how you can use the keyboard to work with the Find and ...
Discover MoreWhen searching for text, Word can helpfully highlight all instances of what is found. If you want that highlighting to be ...
Discover MoreDo you want to quickly search for any footnote or endnote marks in your document? Word makes it easy using the standard ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments