Help Center

CTextRange2.Pastemethod

Pastes text from a specified data object.

Windowsmethoddocumented

Syntax

FUNCTION Paste (BYVAL pVar AS VARIANT PTR, BYVAL Format AS LONG = 0) AS HRESULT

Parameters

NameDescription
pVarThe IDataObject to paste. However, the contents of the clipboard are used if any of the following are true.
- pVar is null
- pVar punkVal is null
- pVar is not VT_UNKNOWN
- pVar punkVal does not return an IDataObject when queried for one
FormatThe clipboard format to use in the paste operation. Zero is best format, which usually is RTF, but CF_UNICODETEXT and other formats are also possible. The default value is zero. For more information, see Clipboard Formats.

Return value

If the method succeeds, GetLastResult returns S_OK. If the method fails, it returns one of the following error codes.

Description

Pastes text from a specified data object.

Remarks

For more information, see Copy.

Reference

  • Defined in AfxNova/CTextRange2.inc:659
  • Documented in Windows/WIndows Controls/RichEdit/CTextRange2 Class.md
  • Topic: CTextRange2 Class