ITextStoreAnchor::InsertTextAtSelection method (textstor.h)

Inserts text at the insertion point or selection.


HRESULT InsertTextAtSelection(
  [in]  DWORD       dwFlags,
  [in]  const WCHAR *pchText,
  [in]  ULONG       cch,
  [out] IAnchor     **ppaStart,
  [out] IAnchor     **ppaEnd


[in] dwFlags

Specifies whether the paStart and paEnd parameters will contain the results of the text insertion.

The TF_IAS_NOQUERY and TF_IAS_QUERYONLY flags cannot be combined.

Value Meaning
Text is inserted, and the values of the ppaStart and ppaEnd parameters can be NULL. Use this flag if the results of the text insertion are not required.
Text is not inserted, and the ppaStart and ppaEnd anchors contain the results of the text insertion. The values of these parameters depend on how the application implements text insertion into a document. Use this flag to view the results of the text insertion without actually inserting the text. Zero-length text can be inserted.

[in] pchText

Pointer to the string to insert in the document. The string can be NULL terminated.

[in] cch

Specifies the text length.

[out] ppaStart

Pointer to the anchor object at the start of the text insertion.

[out] ppaEnd

Pointer to the anchor object at the end of the text insertion. For an insertion point, this parameter value will be the same as the value of the ppaStart parameter.

Return value

This method can return one of these values.

Value Description
The method was successful.
The method could not instantiate one of the anchors paStart or paEnd.
The pchText parameter is invalid.
The caller does not have a lock on the document.


Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header textstor.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also




TF_IAS_* Constants