ITextRange::Cut method

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 codeDescription
E_ACCESSDENIED

Text is write-protected.

E_OUTOFMEMORY

Out of memory.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextRange
Conceptual
Text Object Model

 

 

Show: