Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ITextStoreAnchor::InsertEmbeddedAtSelection method

The ITextStoreAnchor::InsertEmbeddedAtSelection method inserts an IDataObject object at the insertion point or selection. The client that calls this method must have a read/write lock before inserting an IDataObject into the text stream.

Syntax


HRESULT InsertEmbeddedAtSelection(
  [in]   DWORD dwFlags,
  [in]   IDataObject *pDataObject,
  [out]  IAnchor **ppaStart,
  [out]  IAnchor **ppaEnd
);

Parameters

dwFlags [in]

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

The TF_IAS_NOQUERY and TF_IAS_QUERYONLY flags cannot be combined.

ValueMeaning
TF_IAS_NOQUERY

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.

TF_IAS_QUERYONLY

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, for example, to predict the results of collapsing or otherwise adjusting a selection.

 

pDataObject [in]

Pointer to the IDataObject object to be inserted.

ppaStart [out]

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

ppaEnd [out]

Pointer to the anchor object at the end of the object 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.

ValueDescription
S_OK

The method was successful.

E_FAIL

The method could not instantiate one of the anchors paStart or paEnd.

E_INVALIDARG

The pchText parameter is invalid.

E_OUTOFMEMORY

The method could not instantiate one of the anchors paStart or paEnd.

TS_E_NOLOCK

The caller does not have a lock on the document.

 

Remarks

Clients must use this method to insert an object into a text stream, since a TS_CHAR_EMBEDDED constant cannot be passed into ITextStoreAnchor::SetText.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Redistributable

TSF 1.0 on Windows 2000 Professional

Header

Textstor.h

IDL

Textstor.idl

DLL

Msctf.dll

See also

ITextStoreAnchor
IDataObject
TF_IAS_* Constants
TS_CHAR_EMBEDDED
ITextStoreAnchor::SetText
ITextStoreAnchor::QueryInsertEmbedded

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.