ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open HTML document as text file (https://www.excelbanter.com/excel-programming/410982-open-html-document-text-file.html)

Mark[_66_]

open HTML document as text file
 
Hello, I have code in my program that can open HTML text files and
search them for hrefs. There are also HTML Documents that I need to
search. If selected they open in IE, if I right click and say open
with, then they open as a text file. Is there a way to do this in my
code?

Gary''s Student

open HTML document as text file
 
This works:

Sub Macro1()
Dim s As String
Open "C:\x.html" For Input As #1 Len = 1
i = 1
Do Until EOF(1)
s = Input(1, #1)
Cells(i, "A").Value = s
i = i + 1
Loop
Close #1
End Sub

You may need to "re-package" the characters.
--
Gary''s Student - gsnu200786


"Mark" wrote:

Hello, I have code in my program that can open HTML text files and
search them for hrefs. There are also HTML Documents that I need to
search. If selected they open in IE, if I right click and say open
with, then they open as a text file. Is there a way to do this in my
code?



All times are GMT +1. The time now is 01:40 PM.

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