RunBegin property

Microsoft Visio Developer Reference

RunBegin property

   Example   

Returns the beginning index of a type of run—a sequence of characters that share a particular attribute, such as character, paragraph, or tab formatting; or a word, paragraph, or field.

Version added

3.0

Syntax

intRet = object.RunBegin(runType)

intRet

Long. The beginning index of the run.

object

Required. An expression that returns a Characters object.

runType

Required Integer. The type of run to get.

Remarks

In a ShapeSheet window, each row in the Character and Paragraph sections represents a run of the corresponding format in a shape's text. Certain words may be bold or italic, or one paragraph may be centered and another left-aligned. Each change of format represents a run of that format. Similarly, delimiters such as spaces and paragraph marks represent the beginning and end of words, paragraphs, and fields.

In addition, you can retrieve rows that represent runs of character, paragraph, and tab formats by specifying a row index as an argument to the CellsSRC property of a shape.

Use the RunBegin property to determine the beginning of a sequence of identically formatted characters or the beginning of a word, paragraph, or field. You can check the IsField property to determine whether a run is a field.

The index that the RunBegin property returns is less than or equal to the beginning index of a Characters object. If the Begin property of the Characters object is already at the start of a run, the value of the RunBegin property is equal to the value of Begin.

Use the runType argument to specify the type of run you want. You can also use any of the following constants declared by the Visio type library in member VisRunTypes.

Constant

Value

Description

visCharPropRow

1

Reports runs of characters with common character properties. Corresponds to set of characters covered by one row in shape's Character section.

visParaPropRow

2

Reports runs of characters with common paragraph properties. Corresponds to set of characters covered by one row in shape's Paragraph section.

visTabPropRow

3

Reports runs of characters with common tab properties. Corresponds to set of characters covered by one row in shape's Tabs section.

visWordRun

10

Reports runs whose boundaries are between successive words in shape's text. Mimics double-clicking to select text.

visParaRun

11

Reports runs whose boundaries are between successive paragraphs in shape's text. Mimics triple-clicking to select text.

visFieldRun

20

Reports runs whose boundaries are between characters that are and aren't the result of the expansion of a text field, or between characters that are the result of the expansion of distinct text fields.