次の方法で共有


ClipboardPaste Method

ClipboardPaste Method

Copies the IDataObject Leave Site from the Clipboard to the InkDisp object.

Declaration

[C++]

[C++]
HRESULT ClipboardPaste (
    [in, optional, defaultvalue(0)] long x,
    [in, optional, defaultvalue(0)] long y,
    [in, optional, defaultvalue(0)] IDataObject* dataObject,
    [out,retval] IInkStrokes** Strokes
);

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Function ClipboardPaste( _
    [x As Long], _
    [y As Long], _
    [dataObject As IDataObject] _
) As InkStrokes

Parameters

x

[in, optional] Specifies the x-coordinate to paste to in ink space coordinates. The default value is 0.

y

[in, optional] Specifies the y-coordinate to paste to in ink space coordinates. The default value is 0.

dataObject

[in, optional] Specifies the IDataObject Leave Site to be used. To paste from the Clipboard, set to NULL (Nothing in Visual Basic 6.0). The default value is a NULL pointer.

Return Value

This method returns the InkStrokes collection it pastes to the InkDisp object.

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

An error is returned if an unexpected error occurs while accessing the Clipboard. If no error occurs but the Clipboard does not contain a format that can be pasted into ink—either ink serialized format (ISF) or a text ink object (tInk)—then NULL (Nothing in Visual Basic 6.0) is returned and no exception is thrown. For more information about the Clipboard, see Clipboard Leave Site in MSDN®

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example demonstrates pasting an IDataObject Leave Site , theDataObject, to an InkCollector, theInkCollector, at XY position {100, 100}.

Dim theStrokes As InkStrokes
Set theStrokes = theInkCollector.Ink.ClipboardPaste(100, 100)

Applies To