Re: remove spaces from Word

Subject: Re: remove spaces from Word
From: Lauren <lauren -at- writeco -dot- net>
To: techwr-l -at- lists -dot- techwr-l -dot- com
Date: Fri, 22 Mar 2013 13:53:43 -0700

On 3/21/2013 7:58 AM, Keith Hood wrote:

...If you do a "replace all" someone later will find the place where that long string of blanks was removed and now there is content that is misaligned.

Or search for punctuation followed by white space. If this is in a macro, then the macro can run the search for each type of possible punctuation, like (sans commas) ., .", :, !, etc.

On 3/21/2013 8:35 AM, sphilip wrote:
What I was wondering was which was the least work : convert all the
word files into plain text, run them through sed, put them back into
Word OR could I do it all in Word with an already existing macro?

Write or record a macro. Here is what I just recorded in Word 2003 if it doesn't get blocked by the mailer for being a macro. It removes extra white space after each period and each colon. If the macro wrecks formatting, then one click of undo will restore the document.

Sub RemoveWhiteSpace()
'
' RemoveWhiteSpace Macro
' Macro recorded 3/22/2013 by Lauren
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ". ^w"
.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
With Selection.Find
.Text = ": ^w"
.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


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
EPUB Webinar: Join STC Vice President Nicky Bleiel as she discusses tips for creating EPUB, the file format used for e-readers, tablets, smartphones, and more.

Learn more: http://bit.ly/12LyN2z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-
To unsubscribe send a blank email to
techwr-l-leave -at- lists -dot- techwr-l -dot- com


Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwhirl.com/email-discussion-groups/ for more resources and info.

Looking for articles on Technical Communications? Head over to our online magazine at http://techwhirl.com

Looking for the archived Techwr-l email discussions? Search our public email archives @ http://techwr-l.com/archives


References:
remove spaces from Word: From: phil stokes
Re: remove spaces from Word: From: yehoshua paul
RE: remove spaces from Word: From: Combs, Richard
Re: remove spaces from Word: From: sphilip

Previous by Author: Re: remove spaces from Word
Next by Author: Re: remove spaces from Word
Previous by Thread: RE: remove spaces from Word
Next by Thread: Re: remove spaces from Word


What this post helpful? Share it with friends and colleagues:

Sponsored Ads


Sponsored Ads