I have a bad habit of hitting the CapsLock key and when I type code, the shift key does the opposite,
so instead of typing m_bSomeVariable, I will look up and see that I have typed M_BsOMEvARIABLE.
DevStudio provides <Shift><U> and <Ctrl><Shift><U> to lower and upper case
a selection, but nothing provides a "SwapCase" function. The following macro will do the swap. I
assigned it to <Alt><U>, but that is entirely up to you ....
' DESCRIPTION: Macro to swap the case of selected words.
' David Little
' COADE, Inc.
' Houston, TX
str = ActiveDocument.Selection.Text
str1 = ""
i = 1
Do While (i < Len(str)+1)
If (Mid(str, i, 1) = LCase(Mid(str, i, 1))) Then
str1 = str1 + UCase(Mid(str, i, 1))
str1 = str1 + LCase(Mid(str, i, 1))
i = i + 1
ActiveDocument.Selection.Text = str1