ITextRange::Cut method (tom.h)

Cuts the plain or rich text to a data object or to the Clipboard, depending on the pVar parameter.

Syntax

HRESULT Cut(
  VARIANT *pVar
);

Parameters

pVar

Type: VARIANT*

The cut text. pVar->ppunkVal is the out parameter for an IDataObject object, provided that the following conditions exist:

  • pVar->vt = (VT_UNKNOWN | VT_BYREF)
  • pVar is not null
  • pVar->ppunkVal is not null
Otherwise, the clipboard is used.

Return value

Type: HRESULT

This method returns an HRESULT value. If successful, it returns S_OK. Otherwise it returns one of the following values. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_ACCESSDENIED
Text is write-protected.
E_OUTOFMEMORY
Out of memory.

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

Conceptual

ITextRange

Reference

Text Object Model