Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Underlining Quoted Text

Changing Tabs Using the Ruler

Moving Drawing Objects

Standardizing Note Reference Placement

Selecting Printing of Color Pictures

Stubborn Foreign Languages

Sizing the Preview Pane

 

Consistent Spacing in WordBasic

Summary: Want to make sure you have the same number of spaces at the end of every sentence? This WordBasic macro will help you be consistent. (This tip works with Microsoft Word 6, and Word 95.)

There is an unwritten rule in typesetting that there should only be one space after the end of a sentence. This provides the best visual appearance on a printed page, particularly when using proportional typefaces. (If you are using monospace fonts, as you would on a typewriter, then you should use two spaces after the end of a sentence.) The problem is that it is easy to add additional spaces at the end of a sentence without even realizing it. The following WordBasic macro, CheckSpaces, is a tool you can use to double-check the end of your sentences.

Sub MAIN
MakeChanges("Body text", ".")
MakeChanges("Body text", "!")
MakeChanges("Body text", ":")
MakeChanges("Body text", Chr$(34))
End Sub

Sub MakeChanges(StyName$, PuncMark$)
FromWord$ = PuncMark$ + "   "
ToWord$ = PuncMark$ + " "
StartOfDocument
EditFindStyle .Style = StyName$
EditReplace .Find = FromWord$, .Replace = ToWord$, \
   .WholeWord = 0, .MatchCase = 0, .Format = 1, .ReplaceAll = 1
FromWord$ = PuncMark$ + "  "
EditReplace .Find = FromWord$, .ReplaceAll = 1
End Sub

CheckSpaces will only take extra spaces out of paragraphs formatted with the Body text style. This ensures you won't mess up formatting in tables or other design elements where you may want extra spaces after periods. If you want to change the type of punctuation searched for, or search in different style paragraphs, add additional calls to MakeChanges after the fifth line in the macro.

Tip #261 applies to Microsoft Word versions: 6 | 95

Find and Replace Almost Anything! An invaluable resource for learning how to harness the full power of Word's search and replace capabilities. You'll discover everything you need in order to master all the intricacies of finding and replacing elements of your document, including the super-powerful "wildcard searches" available in Word.
 
Check out WordTips: Find and Replace today!