TextSelection.ChangeCase Method

Changes the case of the selected text.

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

void ChangeCase (
	[InAttribute] vsCaseOptions How
)
void ChangeCase (
	/** @attribute InAttribute() */ vsCaseOptions How
)
function ChangeCase (
	How : vsCaseOptions
)

Parameters

How

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

Community Additions

ADD
Show: