Skip to content

Latest commit

 

History

History
139 lines (103 loc) · 4.13 KB

nf-tom-itextrange-setformattedtext.md

File metadata and controls

139 lines (103 loc) · 4.13 KB
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.
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
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
ITextRange::SetFormattedText
tom/ITextRange::SetFormattedText
c++
APIRef
kbSyntax
COM
Msftedit.dll
ITextRange.SetFormattedText

ITextRange::SetFormattedText

-description

Sets the formatted text of this range text to the formatted text of the specified range.

-parameters

-param pRange [in]

Type: ITextRange*

The formatted text to replace this range's text.

-returns

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
Text is protected.
E_INVALIDARG
pRange is null.
E_OUTOFMEMORY
Out of memory.

-remarks

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

-see-also

Conceptual

GetDuplicate

GetFormattedText

ITextRange

Reference

Text Object Model