End property (Characters object)

Microsoft Visio Developer Reference

End property (Characters object)

   Example   

Returns or sets the ending index of the indicated Characters object representing a range of text in a shape.

Version added

3.0

Syntax

intRet = object.End
object.End = intExpression

intRet

Integer. The current ending index of the Characters object.

object

Required. An expression that returns a Characters object.

intExpression

Required Integer. The new ending index of the Characters object.

Remarks

The End property determines the end of the text range represented by a Characters object. The value of the End property is an index that represents the boundary between two characters, similar to an insertion point in text. Like selected text in a drawing window, a Characters object represents the sequence of characters that are affected by subsequent actions, such as the Cut or Copy method. When you retrieve a Characters object, its current text range includes all the shape's text. You can change the text range by setting the Characters object's Begin and End properties. Changing the text range of a Characters object has no effect on the text of the corresponding shape.

The End property can have a value from zero (0) to the value of the CharCount property for the corresponding shape. An index of 0 is positioned before the first character in the shape's text. An index that is the same as the CharCount property is positioned after the last character in the shape's text. If you specify a value less than 0, Visio uses 0. If you specify a value that is inside the expanded characters of a field, Visio sets the value of the End property to the end of the field.

The value of the End property must always be greater than or equal to the value of the Begin property. If you attempt to set the value of the End property to a value lower than the Begin property, Visio sets both the End and Begin properties to the value specified for the End property.