Robert Berke
asked on
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
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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad you have progress 😊
ASKER
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.CheckGrammarWithSp elling = True Then
Selection.Find.ClearFormat ting
Selection.Find.Replacement .ClearForm atting
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.CheckGramma r
Else
ActiveDocument.CheckSpelli ng
End If
MsgBox "The spelling and grammer check is complete."
End Sub
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.CheckGrammarWithSp
Selection.Find.ClearFormat
Selection.Find.Replacement
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.CheckGramma
Else
ActiveDocument.CheckSpelli
End If
MsgBox "The spelling and grammer check is complete."
End Sub
ASKER
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.CheckGrammarWithSp
Selection.Find.ClearFormat
Selection.Find.Replacement
With Selection.Find
.Text = "([ ])[ ]{1,}"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
.MatchWildcards = False
.Wrap = wdFindAsk
End With
ActiveDocument.CheckGramma
Else
ActiveDocument.CheckSpelli
End If
End Sub