Export (0) Print
Expand All

TextSelection.CharRight Method

Moves the object the specified number of characters to the right.

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

void CharRight (
	[OptionalAttribute] [InAttribute] bool Extend,
	[OptionalAttribute] [InAttribute] int Count
void CharRight (
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean Extend, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ int Count
function CharRight (
	Extend : boolean, 
	Count : int



Optional. Determines whether the moved text is collapsed or not. The default is false.


Optional. Represents the number of characters to move to the right. The default is 1.

If Extend is true, then the active end of the selected text is moved right Count characters. Otherwise, the selected text is collapsed and positioned Count characters to the right of the active end.

If the end of the document is encountered before Count characters, then the position is left at the end of the document. If the active end is at the end of a line, then CharLeft leaves it at the beginning of the next line. That is, all newline sequences are treated as a single character.

If Count is negative, then CharRight acts like the CharLeft method.

Sub CharRightExample()
   ' Open a document before running this example.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   objSel.CharRight(True, 4)
   MsgBox("Turned text uppercase.")
   objSel.CharLeft(False, 1)
   MsgBox("Turned text lowercase.")
End Sub

Community Additions

© 2014 Microsoft