IVsTextView.GetSelectionDataObject(IDataObject) Method

Definition

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

public:
 int GetSelectionDataObject([Runtime::InteropServices::Out] Microsoft::VisualStudio::OLE::Interop::IDataObject ^ % ppIDataObject);
public:
 int GetSelectionDataObject([Runtime::InteropServices::Out] Microsoft::VisualStudio::OLE::Interop::IDataObject ^ &  ppIDataObject);
int GetSelectionDataObject([Runtime::InteropServices::Out] Microsoft::VisualStudio::OLE::Interop::IDataObject const & & ppIDataObject);
public int GetSelectionDataObject (out Microsoft.VisualStudio.OLE.Interop.IDataObject ppIDataObject);
abstract member GetSelectionDataObject : IDataObject -> int
Public Function GetSelectionDataObject (ByRef ppIDataObject As IDataObject) As Integer

Parameters

ppIDataObject
IDataObject

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

Returns

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

Remarks

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.

Applies to