ITextRange2::SetText2 method

Sets the text of this range.

Syntax


HRESULT SetText2(
  [in]  long Flags,
  [in]  BSTR bstr
);

Parameters

Flags [in]

Type: long

Flags controlling how the text is inserted in the range. The flag can be one of the following values:

tomUnicodeBiDi
tomMathCFCheck
tomUnlink
tomUnhide
tomCheckTextLimit
tomLanguageTag
bstr [in]

Type: BSTR

The new text.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see Error Handling in COM.

Return codeDescription
E_INVALIDARG

Invalid argument.

E_ACCESSDENIED

Write access is denied.

E_OUTOFMEMORY

Insufficient memory.

 

Remarks

If the bstr parameter is NULL, the text in the range is deleted.

This method is similar to ITextRange:: SetText, but lets the client specify flags that control various insertion options, including the special flag tomLanguageTag to get the BCP-47 language tag for the range. This is an industry standard language tag that may be preferable to ITextFont::SetLanguageID, which uses a language code identifier (LCID).

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

ITextRange2
ITextRange2::GetText2

 

 

Community Additions

ADD
Show:
© 2014 Microsoft