I have an HTML file C:\Program Files\my_html_files\file.html
. How do I open this file using VBScript? (By "open" I mean open it with the default application, as if it was double-clicked in Explorer.)
views:
76answers:
2
A:
You can use the File System Object like this:
Set FSO=CreateObject("Scripting.FileSystemObject")
Set iFile = FSO.OpenTextFile ("C:\Program Files\my_html_files\file.html")
Data = iFile.ReadAll
MsgBox(Data)
iFile.Close
Sarfraz
2010-08-09 08:00:42
It not goodI need the action as double click on the file.htmlYour script not display the real file.html
lidia
2010-08-09 08:18:47
+1
A:
Do you mean open the file in Internet Explorer?
Dim objIE
'' Create an IE object
Set objIE = CreateObject("InternetExplorer.Application")
'' Open file
objIE.Navigate "C:\Program Files\my_html_files\file.html"
Remou
2010-08-09 08:43:04