Anybody working with MS Word documents and overwriting an original formatted text will often find that they need to change the word order, say from ‘interest general’ to ‘general interest’. This can obviously be done by cutting and pasting, drag and drop, and so on, but it suddenly came to me that what you need is a little macro to do this. In fact I have written two, one to change ‘interest general’ to ‘general interest’ and the other to change ‘Interest general’ to ‘General interest’ – ie changing the case at the same time so that the first word starts with a capital letter after the switch. I have found these macros extremely useful (though this is because of my particular translation techniques, and also because the Romance languages which I translate often reverse English word order for noun + adjective etc.), and here they are as a resource for anyone else who wants them. They can quickly be integrated into your normal typing. It would be easy to create similar macros for three-word groups, but it is probably not worth it, as you wouldn’t remember what you were doing.
Sub switch()
'
' switch Macro
' Macro recorded 7/6/2006 by jim
'
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Cut
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.PasteAndFormat (wdPasteDefault)
End Sub
Sub switchcaps()
'
' switchcaps Macro
' Macro recorded 7/6/2006 by jim
'
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdLowerCase
Selection.MoveRight Unit:=wdWord, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdUpperCase
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Cut
Selection.MoveRight Unit:=wdWord, Count:=1
Selection.PasteAndFormat (wdPasteDefault)
End Sub
Copyright © ProZ.com, 1999-2024. All rights reserved.