Tuesday, August 24, 2010

Kill Double Spaces

It's 2010. You're reading this on a computer. You don't write on a typewriter. Likewise, you probably don't write in a fixed-width font (like Courier). If you do use a typewriter-esque, fixed-width font: STOP IT!  They're ugly, archaic and less readable than variable-width fonts. If you use variable width fonts there is no reason, other than habit, to use two spaces after a period. This is actually a fairly controversial issue. A controversy which I have no interest in addressing.

I know what you're thinking. I was taught to use two spaces after each sentence too. It's a difficult habit to break. This macro will help.

Sub Kill_Multiple_Spaces()
' Kill_Multiple_Spaces Macro
    With Selection.Find
        .Text = " {2,}"
        .Replacement.Text = " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

1 comment: