ITextRange::Paste method (tom.h)

Pastes text from a specified data object.

Syntax

HRESULT Paste(
  VARIANT *pVar,
  long    Format
);

Parameters

pVar

Type: VARIANT*

The 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

Format

Type: long

The 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

Type: HRESULT

If the method succeeds, it returns S_OK. If the method fails, it returns one of the following error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_ACCESSDENIED
Destination is write-protected.
E_OUTOFMEMORY
Destination cannot contain the text to be pasted.

Remarks

For more information, seeITextRange::Copy.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

Clipboard Formats

Conceptual

Copy

ITextRange

Reference

Text Object Model