Begin property

Microsoft Visio Developer Reference

Begin property

   Example   

Gets or sets the beginning index of a Characters object, which represents a range of text in a shape.

Version added

3.0

Syntax

intRet = object.Begin
object.Begin = intExpression

intRet

Integer. The current beginning index of the Characters object.

object

Required. An expression that returns a Characters object.

intExpression

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

Remarks

The Begin property determines the beginning of the text range represented by a Characters object. The value of the Begin 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 Begin property can have a value from zero (0) to the value of the CharCount property for the corresponding shape. An index of 0 is before the first character in the shape's text. An index that is the same as the CharCount property is 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 Begin property to the start of the field.

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