This documentation is archived and is not being maintained.

IVsTextView.GetSelectionDataObject Method

Returns a copy of the selected text in IDataObject interface format.

Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in microsoft.visualstudio.textmanager.interop.dll)

int GetSelectionDataObject (
	out IDataObject ppIDataObject
)
int GetSelectionDataObject (
	/** @attribute OutAttribute() */ /** @ref */ IDataObject ppIDataObject
)
JScript does not support passing value-type arguments by reference.

Parameters

ppIDataObject

[out] Pointer to an IDataObject object containing the selected text.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From textmgr.idl:

HRESULT IVsTextView::GetSelectionDataObject(
   [out] IDataObject **ppIDataObject
);

Use this method to return a selected span of text in a data object, rather that returning the text in a BSTR. This allows you to retain the formatting associated with the data object when you transfer the text to another application. For more information, see IDataObject.

Show: