Microsoft XML SDK 2.6 - XML Reference

insertData Method

Inserts the supplied string at the specified offset.

oXMLDOMCharacterData.insertData(offset, data)

Parameters

offset
Long integer specifying the offset, in characters, at which to insert the supplied string data.
data
String containing the data that is to be inserted into the existing string.

Remarks

The length property is updated by this operation.

Example

The following VBScript example creates an XMLDOMComment object and uses the insertData method to insert a string into it:

Dim xmlDoc
Dim comment
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set comment = xmlDoc.createComment("Hello World!")
comment.insertData 6, "Beautiful "
MsgBox (comment.xml)

See Also

Applies To: XMLDOMCDATASection Object | XMLDOMCharacterData Object | XMLDOMComment Object | XMLDOMText Object