Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

open HTML document as text file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 15 May 2008 15:32 GMT
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 - 15 May 2008 16:22 GMT
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.
Signature

Gary''s Student - gsnu200786

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.