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
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

Advertise on the
WordTips Site

Newest Tips

Arranging Document Windows

Specifying a Backup Location

Controlling Chart Gridlines

Merging Table Cells

Collapsing and Expanding Subdocuments

Zooming With the Keyboard

Initiating a New Search

 

Transposing Words

Summary: Presents a WordBasic macro that allows you to transpose (switch) two adjacent words. (This tip works with Microsoft Word 6, and Word 95.)

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

Create Rock-Solid Lists! Bulleted and numbered lists can help make your writing clearer and easier to follow. If not done properly, however, they can be a nightmare to work with. Discover the ins and outs of Word's lists with this great reference available in two versions.
 
Check out Word Bullets and Numbering today!