Click to return to the XML (Extensible Markup Language) home page    
XMLDOMCharacterData lengt...     XMLDOMCharacterData subst...     XMLDOMCharacterData Objec...    
Web Workshop  |  XML (Extensible Markup Language)

replaceData Method


Replaces the specified number of characters with the supplied string.

Syntax

oXMLDOMCharacterData.replaceData(offset, count, data)

Parameters

offset
Long integer value specifying the offset, in characters, at which to start replacing string data.
count
Long integer value specifying the number of characters to replace.
data
String containing the new data that replaces the old string data.

Example

The following example creates a new XMLDOMComment object, then replaces the first five characters with a new string:

Dim xmlDoc
Dim comment

Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set comment = xmlDoc.createComment("Hello World!")
MsgBox comment.xml
comment.replaceData 0,5,"Goodbye, Cruel"
MsgBox comment.xml

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMText


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.