Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access an HTML document

Status
Not open for further replies.

PeteG

Programmer
Joined
Feb 23, 2001
Messages
144
Location
GB
Hi,
I'd like to read the contents of an HTML document into a recordset (or an array). Does anyone have a simple way that I can get started, eg how to make a reference to the actual document and maybe move through the various 'elements' of an HTML doc? Or does anyone have any useful links for this sort of thing?

I'm assuming I'll be using the MSHTML object library but I can't quite work out where to begin....

Many thx
Pete
 
Reference the Microsoft Scripting Runtime

Code:
Dim oFilesystem As Scripting.FileSystemObject
Dim oHTMLFile As Scripting.TextStream
Dim sHTMLFile As String

Set oFilesystem = New Scripting.FileSystemObject
Set oHTMLFile = oFilesystem.OpenTextFile("yourfile.htm")

sHTMLFile = oHTMLFile.ReadAll

Now you can analyse the string and e.g. search for &quot;<&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top