open HTML document as text file

M

Mark

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?
 
G

Gary''s Student

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top