Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Setting Fraction Bar Overhang Spacing in the Equation Editor
Printing On Both Sides of the Paper
Turning Off AutoComplete for Dates
Understanding Auto Line Spacing
Adding Comments to Your Document
Conditional Calculations in Word
It is not uncommon, when editing a document, to transpose two adjacent words. For instance, you may want the text "often used" to be "used often" instead. Word has no native capability to transpose two words, but you can create a macro that will do the transposition for you. The following WordBasic macro, called Transpose, can be used in Word 6 and Word 95.
Sub MAIN CharLeft 1, 1 Space$ = "" If Selection$() = " " Then Space$ = " " EditClear End If WordLeft 1, 1 EditCut WordRight 1 CharLeft 1, 1 If Selection$() = " " Then CharLeft 1 Else CharRight 1 EndIf If Space$ = " " Then Insert Space$ EditPaste End Sub
To use the macro, all you need to do is position the insertion point between the two words you want to transpose, and then run the macro.
Tip #1 applies to Microsoft Word versions: 6 95
Save Time! WordTips has been published weekly since early 1997. Past issues are available in convenient WordTips archives. Have your own enhanced archive of WordTips at your fingertips, available to use at any time!