Microsoft Word: One Space or Two After Each Sentence?

Microsoft Word: One Space or Two After Each Sentence?

Depending on the corporate or university style guide rules you must follow, you may need to adjust the paper you have just written.

A Microsoft Word user asked me recently if there was a way to scan a document programmatically to fix a sentence spacing problem where the author had typed two blank spaces after every sentence, because the standard for her company is to only use one blank space.

Yes, a special macro can do this and I’ve provided one at the end of this post, but you don't necessarily need one to perform the task.

And, in the spirit of learning, I also want to share some other information about this topic for those who are interested. I recommend an interesting background article titled “One space between each sentence, they said.  Science just proved them wrong.” It was written by Avi Selk and published in the Washington Post.


For authors as they write

Word's Grammar Checking Function

If you have any control over the authors of the documents you are editing, I suggest you instruct them to use Word's built-in Grammar Checking function. It can highlight the sentence spacing issue automatically. Follow these 3 steps to turn on this feature:

1. Open Word and go to File > Options, which opens the Word Options dialog.

2. From the left panel select Proofing and scroll down in the right panel to find the Writing Style: Grammar Settings button.

3. Click Settings to open the Grammar Settings dialog and scroll down to find the Space Between Sentences control. Click the little arrow next to don’t check to change the option.


For existing documents with sentence spacing issues

To perform a special Find and Replace without using a macro, use the Advanced Find and Replace function of Microsoft Word, which is on the Home tab and in the Editing group on Word's ribbon.

1. Click on the Editing button and select the option to Replace.

2. In the Find and Replace dialog box you will see, use the More >> button to expand the dialog.

3. You will now see the extra options shown in the screen clip below.

4. In the "Find what:" box type a single blank space followed by a {2,} as shown in the sample. The blank space is highlighted in blue in this example.

The {2,} is a wildcard search string that is telling Word to find where in the document there are two or more consecutive blank spaces. For more information on writing wildcard search strings see Graham Mayor's website.

5. In the "Replace with:" box type a single blank space. It's highlighted in blue on my example above.

6. The final thing to mark on the Find and Replace dialog is the checkbox to "Use wildcards."

7. Click "Replace All" to correct all strings of two or more blank spaces.


A special macro that does the job for you

If fixing sentence spacing is a common scenario, you may want to save yourself some typing time and just press a custom button or custom keystroke sequence to run a special macro that does the job for you.

The following VBA (Visual Basic for Applications) code subroutine is the custom Find and Replace macro you will need.


Sub FindAndReplaceEmptySpaces()
    Dim rng As Word.Range
    Set rng = ActiveDocument.Content
    With rng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = " {2,}" 'look for 2 or more
        .Replacement.Text = " " 'replace with 1
        .Forward = True
        .Wrap = Word.WdFindWrap.wdFindStop
        .Format = False
        .MatchWildcards = True
    End With
    rng.Find.Execute Replace:=Word.WdReplace.wdReplaceAll
    rng.Find.ClearFormatting
    rng.Find.Replacement.ClearFormatting
End Sub

If you don't know how if to install custom macros into Microsoft Word, do a web search using the search string "word vba install custom macros" and you'll find a few links that explain how. With that said, I now realize that I should write up a procedure for doing this and get it either into our blog or website …

Oh well. What's that saying? Something about no rest for the weary writer?

How to Deal with Mr. Moocher

How to Deal with Mr. Moocher

Passion

Passion