Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ITextStoreACP2::InsertEmbeddedAtSelection method

Inserts an IDataObject at the insertion point or selection. The client that calls this method must have a read/write lock before inserting an IDataObject object into the document.

Syntax


HRESULT InsertEmbeddedAtSelection(
  [in]   DWORD dwFlags,
  [in]   IDataObject *pDataObject,
  [out]  LONG *pacpStart,
  [out]  LONG *pacpEnd,
  [out]  TS_TEXTCHANGE *pChange
);

Parameters

dwFlags [in]

Specifies whether the pacpStart and pacpEnd parameters and the TS_TEXTCHANGE structure will contain the results of the object insertion.

The TF_IAS_NOQUERY and TF_IAS_QUERYONLY flags cannot be combined.

ValueMeaning
0

Text insertion will occur, and the pacpStart and pacpEnd parameters will contain the results of the text insertion. The TS_TEXTCHANGE structure must be filled with this flag.

TF_IAS_NOQUERY

Text is inserted, the values of the pacpStart and pacpEnd parameters can be NULL, and the TS_TEXTCHANGE structure must be filled. Use this flag if the results of the text insertion are not required.

TF_IAS_QUERYONLY

Text is not inserted, and the values for the pacpStart and pacpEnd parameter contain the results of the text insertion. The values of these parameters depend on how the application implements text insertion into a document. For more information, see the Remarks section.

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. It is not required that you fill the TS_TEXTCHANGE structure with this flag.

 

pDataObject [in]

Pointer to the IDataObject object to be inserted.

pacpStart [out]

Pointer to the starting application character position where the object insertion will occur.

pacpEnd [out]

Pointer to the ending application character position where the object insertion will occur. This parameter value will be the same as the value of the pacpStart parameter for an insertion point.

pChange [out]

Pointer to a TS_TEXTCHANGE structure with the following members.

ValueMeaning
acpStart

The starting application character position before the object is inserted into the document.

acpOldEnd

The ending application character position before the object is inserted into the document. This value is the same as acpStart for an insertion point. If this value is different from acpStart, then text was selected prior to the object insertion.

acpNewEnd

The ending application character position after the object insertion took place.

 

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_INVALIDARG

The pchText parameter is invalid.

TS_E_NOLOCK

The caller does not have a lock on the document.

 

Remarks

The values of the pacpStart and pacpEnd parameters depend upon how the client application inserts an object into a document. For example, if the application sets the cursor at the start of the object after object insertion, then the value of the pacpStart and pacpEnd parameters is the same as the acpStart member of the TS_TEXTCHANGE structure.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Textstor.h

IDL

Textstor.idl

DLL

Msctf.dll

See also

ITextStoreACP2
TF_IAS_* Constants
TS_TEXTCHANGE
IDataObject

 

 

Community Additions

Show:
© 2014 Microsoft. All rights reserved.