Click or drag to resize
TextRangeSetDataObject Method
Replaces the text in the range with the specified data object.

Namespace: TextObjectModel
Assembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax
public void SetDataObject(
	IDataObject o
)

Parameters

o
Type: System.Windows.FormsIDataObject
The data object containing the new text.
Exceptions
ExceptionCondition
ArgumentNullExceptiono is null.
Remarks

The data object may contain:

Different implementations of the Text Object Model (TOM) may support different formats.

Examples
The following example demonstrates how to set the text in a range using an IDataObject:
C#
void SetDataObjectExample(TextRange range) {
    DataObject data = new DataObject();
    data.SetText("Example text");

    range.SetDataObject(data);
}
See Also