TextSelection::ChangeCase Method (vsCaseOptions)
Visual Studio 2015
Changes the case of the text selection.
Assembly: EnvDTE (in EnvDTE.dll)
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
Show: