Can MS Word 2010 Automatically remove Extra Space between Words?

MS Word grammar checker often says " Extra Space between Words:".  I always click "Change" and continue with the grammar checker.

In the last 5 years this great feature has caught and fixed about 5000 extra spaces, but it is a little annoying.

Does anybody know of trick to make MS Word automatically eliminate these spaces?  I sometimes use find and replace  "  " to " " but I would prefer that word just automatically make the correction.

rberke
LVL 5
rberkeConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrTribosCommented:
Try auto correct?  replace  .. with .

Not sure if that would work, the other way would be to create a marco to do find and replace of double spaces...
Tapan PattanaikSenior EngineerCommented:
Hi rberke,

About Automatically eliminate  spaces in word I am not sure, but this is more  sophisticated  way to  use a wildcard Find/Replace. This will replace any string or more than one space (eg.one, two, three, four ,five ...spaces) with a single space.

 Find = ([ ])[ ]{1,}
Replace = \1

Please find the attached screen shot.
WildCard.PNG

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rberkeConsultantAuthor Commented:
The Autocorrect "From" textbox ignores leading and trailing spaces and does not accept wildcards, so that will not work.

The following macro seems to work, but I won't know for sure until I have used it for a few weeks.

I will post back and let you folks know how successful it was.

Bob

' In Word 2010 the F7 spell checker will frequently ask the user  if double space should be replace a single space.
'
' if this is annoying, you can make replacement be automatic by using this macro.   Customize the ribbon and use the "keyboard shortcuts" to assign the macro to Ctrl Shift F7.
'
    If Options.CheckGrammarWithSpelling = True Then
   
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = "([ ])[ ]{1,}"
            .Replacement.Text = "\1"
            .Forward = True
            .Wrap = wdFindStop
            .MatchWildcards = True
            .Execute Replace:=wdReplaceAll
            .MatchWildcards = False
            .Wrap = wdFindAsk
        End With

        ActiveDocument.CheckGrammar
    Else
        ActiveDocument.CheckSpelling
    End If

End Sub
DrTribosCommented:
Glad you have progress 😊
rberkeConsultantAuthor Commented:
The macro was working well, but I made a small improvement.  This is the final version.

Sub Macro328()
' see experts-exchange question 28693441 from rberke

' In Word 2010 the F7 spell checker will FREQUENTLY ask the user if double space should be replaced by a single space.  I always respond Yes.
'
' I found this to be annoying, so I created this macro. I customized the ribbon and used the "keyboard shortcuts" to assign the macro to Ctrl Shift F7.
'
' Now, whenever I want to spell check, I use control shift F instead of F7, and the annoying message never comes up.
'
'
    If Options.CheckGrammarWithSpelling = True Then
   
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = "([ ])[ ]{1,}"
            .Replacement.Text = "\1"
            .Forward = True
            .Wrap = wdFindContinue  ' This causes the entire document to be processed, not just the selected text.
            .MatchWildcards = True
            .Execute Replace:=wdReplaceAll
            .MatchWildcards = False
            .Wrap = wdFindAsk       ' Return to "standard" behavior. Future find and replaces will ask if the entire document should be processed.
        End With
        ActiveDocument.CheckGrammar
    Else
        ActiveDocument.CheckSpelling
    End If
    MsgBox "The spelling and grammer check is complete."
End Sub
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.