Property

Method

Event

 

 

InsertValue

Inserts specified HTML contents into the current document.

Syntax

    HRESULT InsertValue(
    long position,
    BSTR newVal
    BOOL
    bMergeBoundingPara
    );

Parameters

position

[in] Enter the position to insert the contents.

0

Start of the document.

-1

End of the document.

others

Position of the cursor.

newVal

[in] Contents to insert.

bMergeBoundingPara

[in] Specify whether to break or merge paragraphs. This value is not specified except for the compatible mode for Web Editor Control 2.1.

FALSE

Inserts a paragraph break. (default)

TRUE

Inserts a paragraph without a break.

Return Values

0 (always)

Remarks

Splits the paragraph at the position of the cursor, then inserts the value. Only a paragraph can be inserted. If bMergeBoundingPara Value is TRUE, then the value is inserted without splitting the paragraph.

Sample Codes

JScript

    var objNamo;
    objNamo = document.wec;
    objNamo.InsertValue 1, "New Value" //Insert "New Value" where the cursor is located.

 

VBScript

dim object
set object = document.editForm
object.wec.InsertValue 1, "New Value" ' Insert "New Value" where the cursor is located.

See Also

Value, HeadValue, BodyValue, TextValue, MIMEValue, SelectedValue, SelectedTextValue, SetCaretPos, GetCaretPos