|
Writing to IE or a file won't work This is two problems in one: a problem and a solution that doesn't work.
I need to convert files of plain text and send it to Internet Explorer as
HTML.
So I created an IE object like this:
Set oIE = WScript.CreateObject("InternetExplorer.Application")
oIE.Navigate "About:blank"
Set oIEDoc = oIE.Document
and write to it like this:
oIEDoc.Writeln "<HTML>" . . . . . . . . . . . .
And that creates and displays the correct HTM but it won't display the
pictures.
The picture paths are all correct.
If I ViewSource (in IE), save the page, then change the Navigate line to:
oIE.Navigate "F:\P.htm"
Then rerun it, it will display the photos correctly.
And that tells me it's not an HTML problem.
So question 1:
Does anyone know why IE (vista) won't display the photos when using the
About:blank document?
Then to correct that problem I tried writing the same HTM to a file first,
like this:
Set oFSO = CreateObject ("Scripting.FileSystemObject")
Set oOutput = oFS0.CreateTextFile ("F:\P.htm", true)
oOutput.Writeln "<HTML>" . . . . . . . . . . . .
But this refuses to create the file,
whether the file exists or not nothing happens, no error and no file.
The F: drive has full permissions for everyone,
and it let me create the file manually in Notepad.
So question 2:
Does anyone know why the CreateTextFile method might not work? |