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.SetFormattedText |
ITextRange::SetFormattedText (tom.h) |
Sets the formatted text of this range text to the formatted text of the specified range. |
|
controls\ITextRange_SetFormattedText.htm |
Controls |
VS|Controls|~\controls\richedit\textobjectmodel\textobjectmodelreference\textobjectmodelinterfaces\setformattedtext.htm |
12/05/2018 |
ITextRange interface [Windows Controls],SetFormattedText method, ITextRange.SetFormattedText, ITextRange::SetFormattedText, SetFormattedText, SetFormattedText method [Windows Controls], SetFormattedText method [Windows Controls],ITextRange interface, _win32_ITextRange_SetFormattedText, _win32_ITextRange_SetFormattedText_cpp, controls.ITextRange_SetFormattedText, controls._win32_ITextRange_SetFormattedText, tom/ITextRange::SetFormattedText |
tom.h |
Windows |
Windows Vista [desktop apps only] |
Windows Server 2003 [desktop apps only] |
Msftedit.dll |
Windows |
19H1 |
|
|
|
|
|
|
Sets the formatted text of this range text to the formatted text of the specified range.
Type: ITextRange*
The formatted text to replace this range's text.
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 |
---|---|
|
Text is protected. |
|
pRange is null. |
|
Out of memory. |
If the ITextRange does not belong to the same Text Object Model (TOM) engine, call IUnknown::QueryInterface for an IDataObject interface.
Among the formats typically supported by the IDataObject are CF_TEXT and CF_RTF. In addition, private formats can be used to reference a text solution's own internal rich-text formats. The following Microsoft Visual Basic example uses the FormattedText property to replace the text in range2 with the formatted text in range1.
range2.FormattedText = range1.FormattedText
Conceptual
Reference