Jump to Real's How-to Main page

Create an HTML file

set xdoc = CreateObject("MSXML2.DOMDocument")

set html = xdoc.appendChild(xdoc.CreateElement("HTML"))
set list = html.appendChild(xdoc.createElement("UL"))
set item = list.appendChild(xdoc.createElement("LI"))
set text = xdoc.createTextNode("This is item 1")
item.appendChild text

set item = list.appendChild(xdoc.createElement("LI"))
set text = xdoc.createTextNode("This is item 2")
item.appendChild text

set item = list.appendChild(xdoc.createElement("LI"))
set text = xdoc.createTextNode("This is item 3")
item.appendChild text

set ital = xdoc.createElement("I")
ital.appendChild xdoc.createTextNode("italicized")

set item = list.appendChild(xdoc.createElement("LI"))
item.appendChild xdoc.createTextNode("This is ")
item.appendChild ital
item.appendChild xdoc.createTextNode(" text")

xdoc.save "test.html"

and the result is

<HTML>
<UL><LI>This is item 1</LI>
<LI>This is item 2</LI>
<LI>This is item 3</LI>
<LI>This is <I>italicized</I> text</LI></UL>
</HTML>

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2007
[ home ]