Case switching
Posted
by David Little
on November 29th, 1998
Sub SwapCase() ' DESCRIPTION: Macro to swap the case of selected words. ' ' David Little ' COADE, Inc. ' Houston, TX ' dlittle@coade.com ' 5OCT98 ' 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)) Else str1 = str1 + LCase(Mid(str, i, 1)) End If i = i + 1 Loop ActiveDocument.Selection.Text = str1 End Sub

Comments
There are no comments yet. Be the first to comment!