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)

Syntax

'宣言
Function GetSelectionDataObject ( _
    <OutAttribute> ByRef ppIDataObject As IDataObject _
) As Integer
'使用
Dim instance As IVsTextView
Dim ppIDataObject As IDataObject
Dim returnValue As Integer

returnValue = instance.GetSelectionDataObject(ppIDataObject)
int GetSelectionDataObject(
    out IDataObject ppIDataObject
)
int GetSelectionDataObject(
    [OutAttribute] IDataObject^% ppIDataObject
)
function GetSelectionDataObject(
    ppIDataObject : IDataObject
) : int

Parameters

Return Value

Type: System.Int32

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.

Permissions

See Also

Reference

IVsTextView Interface

IVsTextView Members

Microsoft.VisualStudio.TextManager.Interop Namespace