Swap characters shortcut?

  • Thread starter Thread starter Tom Duprex
  • Start date Start date
T

Tom Duprex

Is there a shortcut in Word 2002 to swap two characters?

For example, I typed "form" instead of "from". If I highligted/selected
the "or" in the word "form" is there a shortcut to swap the two
letters?
 
There probably is not, but I don't know for sure. I have seen such things in
other editors. I think the Microsoft people don't have whatever it is that
we have. I assume it would easy to write a macro and assign it to a
keystroke, but I have not done that for Word.

I know that I usually type "mena" when I mena "mean". It is interesting how
consistent I am about that.
 
If you consistently type "mena" for "mean," it is a good candidate for an
AutoCorrect entry. Next time you do it, instead of correcting it manually or
right-clicking and selecting the correct spelling from the shortcut menu,
instead select AutoCorrect and then the correct spelling.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
However "Mena" is also a name, such as "Mena Suvari" (actress). Is that a
potential problem?

What about all the other possible transpositions? Do I need to specify each
one also in order to AutoCorrect?

I am not Tom, who asked the question, but for me, it would help to have the
feature that he described. If there is not such a feature in Word, then it
helps to know that there is not, so that we know to look for other
solutions, such as AutoCorrect.
 
This sort of swapping function is obviously much desired. I remember that
one of the first Word "tricks" books I ever acquired had a WordBasic macro
to do just this. It's really sort of a show-off technique that for most
users is not that useful: selecting two reversed characters and running a
macro, even using a keyboard shortcut, requires about as much keyboarding as
selecting the characters and retyping them correctly. AutoCorrect entries to
deal with your most common errors, however, do make sense.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Suzanne S. Barnhill said:
This sort of swapping function is obviously much desired.
I remember that one of the first Word "tricks" books I ever
acquired had a WordBasic macro to do just this. It's really
sort of a show-off technique that for most users is not that
useful: selecting two reversed characters and running a
macro, even using a keyboard shortcut, requires about as
much keyboarding as selecting the characters and retyping
them correctly. AutoCorrect entries to deal with your most
common errors, however, do make sense.


If you want a macro anyway, see below.

It works if you first:
-- select both characters to swap,
-- select the first character,
-- or put the cursor between the characters to swap...
and then run the macro.

Else, it gives an error message and does nothing.

For help with macros, how to put them on keyboard shortcuts, and so on:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Regards,
Klaus


Sub Swap()
Select Case (Selection.End - Selection.Start)
Case 0
MsgBox "0"
Selection.MoveStart _
Unit:=wdCharacter, _
Count:=-1
Selection.Characters(1).Cut
Selection.Move Unit:=wdCharacter, _
Count:=1
Selection.Paste
Case 1, 2
MsgBox "1, 2"
Selection.Characters(1).Cut
Selection.Move Unit:=wdCharacter, _
Count:=1
Selection.Paste
Case Else
MsgBox "Which characters?", _
vbCritical, "macro Swap"
End Select
End Sub
 
Sorry, forgot to delete two lines that I had put in for testing:

Sub Swap()
Select Case (Selection.End - Selection.Start)
Case 0
Selection.MoveStart _
Unit:=wdCharacter, _
Count:=-1
Selection.Characters(1).Cut
Selection.Move Unit:=wdCharacter, _
Count:=1
Selection.Paste
Case 1, 2
Selection.Characters(1).Cut
Selection.Move Unit:=wdCharacter, _
Count:=1
Selection.Paste
Case Else
MsgBox "Which characters?", _
vbCritical, "macro Swap"
End Select
End Sub
 
Back
Top