TextSelection::ChangeCase Method (vsCaseOptions)

 

Changes the case of the text selection.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

void ChangeCase(
	vsCaseOptions How
)

Parameters

How
Type: EnvDTE::vsCaseOptions

Required. A vsCaseOptions constant representing the text to insert.

Sub ChangeCaseExample()
   ' Open a document before running this example.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   objSel.StartOfDocument(True)
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsUppercase)
   MsgBox("Turned text uppercase.")
   objSel.CharLeft(False, 1)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsLowercase)
   MsgBox("Turned text lowercase.")
End Sub
Return to top
Show: