bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Editing > Transposing Words

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


Great Idea! Word is a tool to get what you really want—printed output. This means you need to make sure that Word works as well as possible with your printer, whether it is sitting on your desk or in a room down the hall.
 
Check out WordTips: Printing and Printers today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)