Click or drag to resize
TextExtensionsInsert Method
Inserts text at the specified position within the range.

Namespace: TextObjectModel
Assembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax
public static void Insert(
	this TextRange range,
	int index,
	string text,
	[OptionalAttribute] RangeInsertMode mode
)

Parameters

range
Type: TextObjectModelTextRange
The range to insert the text into.
index
Type: SystemInt32
Character position (relative to the start of the range).
text
Type: SystemString
The text to insert.
mode (Optional)
Type: TextObjectModelRangeInsertMode
Controls how the start and end positions of the range are affected.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TextRange. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionindex does not fall within the bounds of the range.
Remarks
This extension method mimics the behaviour of the Insert(Int32, String) method of the StringBuilder class.
See Also