Do you want to add it into a file? Or create a new file? If it's adding, would it be added to the end of the code, or is there a breaking point in the middle? Either way, I would suggest takeing the html "template" file, and writing the portion you need into a temp file, you can put a breaking point in there...eg.
dim TempString
dim InputString as string
dim InputBuf() as byte
dim BreakPoint as string
dim InsertPoint as integer
dim MyLoop as integer
MyLoop = 0
BreakPoint = "<!-- Insert --!>"
open "template.html" for input as #1
do while <> EOF(1)
input #1, TempString
InputString = InputString + TempString
loop
close(1)
InputBuf = StrConv(InputString & chr$(0), vbFromUnicode)
InsertPoint = InStr(0, InputString, BreakPoint)
open "Finish.html" for output as #1
do while MyLoop <= InsertPoint
if (InputBuf(MyLoop) <> 0) then
write #1, chr(InputBuf(MyLoop))
end if
MyLoop = MyLoop + 1
loop
close(1)
open "Finish.html" for append as #1
' Do your other process here, to get the html code
' Then just write #1, programOutput or whatever
close(1)
open "Finish.html" for apend as #1
MyLoop = InsertPoint
do while InputBuf(MyLoop) <> 0
write #1, chr(InputBuf(MyLoop))
MyLoop = MyLoop +1
loop
Now, there may be a better way, and there may be errors in here (I just whipped it up from scratch

) But this is basically how i'd go about it...I'm open to constructive critisizim
Hope it helps, regardless,
Rob