Autocorrect double spacing possible?

  • Thread starter Thread starter Peter in New Zealand
  • Start date Start date
P

Peter in New Zealand

Word 97 SP2 on Windows XP Pro SP2. I have a wireless keyboard I love for its
smooth feel and action. However when typing reasonably fast the space bar
occasionally double hits, giving me a slightly wider space between a couple
of words. At times this can happen every second line or so. Now, I could
go get a new kb, but I love the feel of this one, and so have been trying
to see if I can persuade Word to autocorrect two adjacent spaces to one, as
I normally never need to double space. It won't accept it into the
autocorrect list, and so I am wondering if some gracious person might be
able to suggest something to help me. Many thanks.
 
Search and replace when you have finished the document. Replace two spaces
with one.
 
Thank you Terry. I worked my way through the article (love the Zen hint),
but am I correct in assuming this is to do with running Find/Replace on an
existing block of text or document? What I was really hoping for is a way
to somehow persuade Autocorrect to do it as I type. I apologise if I am
missing something here, and thank you for your patience.
 
You don't really need Wildcards, Rae's simple version will do. You can
record it as a macro to run it easily.

Yes, you have to run the macro on existing text. There will NOT be a way
to get AutoCorrect to do this. AutoCorrect triggers when you type a
space (or punctuation). You can't autocorrect the thing that
AutoCorrect reads as a trigger, I think the resulting loop would make
Word explode. :)
 
Hi Peter,

Terry's suggestion is the best you'll get. AutoCorrect does _not_ work
with spaces. Sorry for the bad news...

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Bother! I really appreciate the helpful comments here, and I understand how
Word's autocorrect actions are triggered by a space (among others). Hmmm,
like the image of Word exploding - sort of Monty Python-esque in a way.
Really, I should stop being so mean and shout myself a nice new keyboard.
Anyway, thanks heaps for the patience and helpful ideas.
 
You can set the Grammar checker to 'Check for # spaces' and it will
highlight with the green squiggle all instances of double spaces - but I
find that it is easy to miss some of these if it is a very long document.
(Tools, Options, Spelling and Grammar, then under grammar sections select
Settings button.) A macro is the more reliable solution.

Terry
 
Someone kindly offered a suggested macro several posts ago but I cannot seem
to locate it any more. Please, can I ask some patient person to repost
it? Many thanks.
 
You can't find it because it wasn't really there. :)

I suggested that you record a macro while doing a Find for "[hit
spacebar two times]" and a Replace with "[hit spacebar once]". It works,
although you may have to run it multiple times to catch three spaces. A
more sophisticated macro would find any multiple number of spaces and
only need to be run once, and Terry Farrell's first post gave you a link
with advice on creating that.

Some relevant links (the macro I use to Replace two spaces with one is
below--I have to select all first):

Creating a macro with no programming experience using the recorder
http://word.mvps.org/faqs/macrosvba/UsingRecorder.htm

How to modify a recorded macro
http://www.word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm

How to assign a Word command or macro to a toolbar or menu
http://word.mvps.org/faqs/customization/AsgnCmdOrMacroToToolbar.htm

What do I do with macros sent to me by other newsgroup readers to help me
out?
I don't know how to install them and put them to use
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Idiots Guide to Installing Macros
http://www.gmayor.com/installing_macro.htm

Sub TwoSpacesToOne()
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 
Goodness me, I must be projecting my desires onto my memory cells or
something. I am sorry - I just got a little muddled. Thank you for patiently
explaining to me, and for the helpful links. I will work this one through.

Kind regards, Peter.


Daiya Mitchell said:
You can't find it because it wasn't really there. :)

I suggested that you record a macro while doing a Find for "[hit spacebar
two times]" and a Replace with "[hit spacebar once]". It works, although
you may have to run it multiple times to catch three spaces. A more
sophisticated macro would find any multiple number of spaces and only need
to be run once, and Terry Farrell's first post gave you a link with advice
on creating that.

Some relevant links (the macro I use to Replace two spaces with one is
below--I have to select all first):

Creating a macro with no programming experience using the recorder
http://word.mvps.org/faqs/macrosvba/UsingRecorder.htm

How to modify a recorded macro
http://www.word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm

How to assign a Word command or macro to a toolbar or menu
http://word.mvps.org/faqs/customization/AsgnCmdOrMacroToToolbar.htm

What do I do with macros sent to me by other newsgroup readers to help me
out?
I don't know how to install them and put them to use
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Idiots Guide to Installing Macros
http://www.gmayor.com/installing_macro.htm

Sub TwoSpacesToOne()
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Someone kindly offered a suggested macro several posts ago but I cannot
seem to locate it any more. Please, can I ask some patient person to
repost it? Many thanks.
 
Here's a macro I use that changes all multiple spaces in document to one
space:

' Changes all double (or more than double) spaces in document to one.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " {2,}": .Replacement.Text = " ": .Forward = True:
.Wrap = wdFindContinue; .MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

'Clear Find parameters
With Selection.Find
.Text = "": .Replacement.Text = "": .MatchWildcards = False
End With


Peter in New Zealand said:
Goodness me, I must be projecting my desires onto my memory cells or
something. I am sorry - I just got a little muddled. Thank you for patiently
explaining to me, and for the helpful links. I will work this one through.

Kind regards, Peter.


Daiya Mitchell said:
You can't find it because it wasn't really there. :)

I suggested that you record a macro while doing a Find for "[hit spacebar
two times]" and a Replace with "[hit spacebar once]". It works, although
you may have to run it multiple times to catch three spaces. A more
sophisticated macro would find any multiple number of spaces and only need
to be run once, and Terry Farrell's first post gave you a link with advice
on creating that.

Some relevant links (the macro I use to Replace two spaces with one is
below--I have to select all first):

Creating a macro with no programming experience using the recorder
http://word.mvps.org/faqs/macrosvba/UsingRecorder.htm

How to modify a recorded macro
http://www.word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm

How to assign a Word command or macro to a toolbar or menu
http://word.mvps.org/faqs/customization/AsgnCmdOrMacroToToolbar.htm

What do I do with macros sent to me by other newsgroup readers to help me
out?
I don't know how to install them and put them to use
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Idiots Guide to Installing Macros
http://www.gmayor.com/installing_macro.htm

Sub TwoSpacesToOne()
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Someone kindly offered a suggested macro several posts ago but I cannot
seem to locate it any more. Please, can I ask some patient person to
repost it? Many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top