ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read MHTML document from Macro (https://www.excelbanter.com/excel-programming/430737-read-mhtml-document-macro.html)

Satish

Read MHTML document from Macro
 
Hi All,

I need to write a macro in which I am required to open a MHTML file
and read its contents. I am currently using the following code -

file_name = sPath & "\" & file.Name 'I am able to get the
name of the file correctly in file.Name
Open file_name For Input As #1
Do While Not EOF(1)
Input #1, Mystring
If InStr(1, Mystring, "<TD bgColor=#cae3e3<B") < 0
Then
MsgBox Mystring
End If
Loop

I am not able to figure out from where exactly does the value in
Mystring gets populated from. I tried doing "view source" in IE on
the mht file, but it doesn't exactly read all the contents from
there.

Any pointers??

Thanks much!
Satish


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com