| TextRangeSetDataObject Method |
Replaces the text in the range with the specified data object.
Namespace: TextObjectModelAssembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax public void SetDataObject(
IDataObject o
)
Public Sub SetDataObject (
o As IDataObject
)
public:
void SetDataObject(
IDataObject^ o
)
Parameters
- o
- Type: System.Windows.FormsIDataObject
The data object containing the new text.
Exceptions 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:
void SetDataObjectExample(TextRange range) {
DataObject data = new DataObject();
data.SetText("Example text");
range.SetDataObject(data);
}
See Also