Setting MIME Type Programatically

Setting MIME Type Programatically

Post by BulletProo » Sun, 28 Sep 2003 18:54:39


Hi Folks

Hope that someone out there can help me...

I'm writing a VB6 application that will generate either HTML or XML
markup on the fly, and then stream this markup directly from a string
variable into an instance of Internet Explorer. I don't want to have
to save the data into an intermediate file.

The whole thing works fine when I'm sending HTML using the following
code...

Set objIE = new SHDocVw.InternetExplorer
With objIE
Call .navigate2("about:blank")
Call .document.open
Call .document.write(strMarkup)
Call .document.close
End With

However, when I'm sending XML, the browser still treats it as HTML,
doesn't recognise the tags, and so displays only the text without the
markup. What I'd like it to do is use its default behaviour for XML
documents (ie apply the treeview stylesheet).

I don't, however want to apply the stylesheet myself - I want the
browser to use its default behaviour dependant upon the data type.

I think that I have to find a way to set the MIME or content type (as
I would do from an ASP page), but I don't know how to do it in this
context and can't find any documentation for this. Can anybody help,
please?

Many thanks in advance,

BPP