Help Center

CTextRange2.CanPastemethod

Determines if a data object can be pasted, using a specified format, into the current range.

Windowsmethoddocumented

Syntax

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

Parameters

NameDescription
pVarThe IDataObject to be pasted. However, the Clipboard contents are checked for pasting if any of the following are true:
- pVar is null
- pVar->punkVal is null
- pVar->vt is not VT_UNKNOWN
- pVar->punkVal does not return an IDataObject object when queried for one
FormatClipboard format that is used. Zero represents the best format, which usually is RTF, but CF_UNICODETEXT and other formats are also possible. The default value is zero.

Return value

A tomBool value that is tomTrue only if the data object identified by pVar can be pasted, using the specified format, into the range.

Description

Determines if a data object can be pasted, using a specified format, into the current range.

Reference

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