UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:tom.ITextRange.Copy |
ITextRange::Copy (tom.h) |
Copies the text to a data object. |
|
controls\ITextRange_Copy.htm |
Controls |
VS|Controls|~\controls\richedit\textobjectmodel\textobjectmodelreference\textobjectmodelinterfaces\copy.htm |
12/05/2018 |
Copy, Copy method [Windows Controls], Copy method [Windows Controls],ITextRange interface, ITextRange interface [Windows Controls],Copy method, ITextRange.Copy, ITextRange::Copy, _win32_ITextRange_Copy, _win32_ITextRange_Copy_cpp, controls.ITextRange_Copy, controls._win32_ITextRange_Copy, tom/ITextRange::Copy |
tom.h |
Windows |
Windows Vista [desktop apps only] |
Windows Server 2003 [desktop apps only] |
Msftedit.dll |
Windows |
19H1 |
|
|
|
|
|
|
Copies the text to a data object.
Type: VARIANT*
The copied text. pVar->ppunkVal is the out parameter for an IDataObject provided that the following conditions exist:
- pVar->vt = (VT_UNKNOWN | VT_BYREF)
- pVar is not null
- pVar->ppunkVal is not null
Type: HRESULT
This method returns an HRESULT value. If successful, it returns S_OK. Otherwise, it returns E_OUTOFMEMORY.
The ITextRange::Cut, ITextRange::Copy, and ITextRange::Paste methods let you perform the usual Cut, Copy, and Paste operations on a range object using an IDataObject, thereby not changing the contents of the clipboard. Among clipboard formats typically supported are CF_TEXT and CF_RTF. In addition, private clipboard formats can be used to reference a text solution's own internal rich text formats.
To copy and replace plain text, you can use the ITextRange::GetText and ITextRange::SetText methods. To copy formatted text from range r1 to range r2 without using the clipboard, you can use Copy and Paste and also the ITextRange::GetFormattedText and ITextRange::SetFormattedText methods, as shown in the following Microsoft Visual Basic example:
r2.GetFormattedText = r1.GetFormattedText
Conceptual
Reference