Solved

Help with code for using Internet Explorer in my app

Posted on 2002-06-23
6
131 Views
Last Modified: 2010-05-02
I am trying to write a small code in VB. This is what I have:

Dim explorer as object
Set explorer = CreateObject("InternetExplorer.Application")

explorer.navigate "http://www.microsoft.com"

Now what I want to do is take all of the text found at the site and then store it into a variable. I am sure its easy to do (add Dim text as String then set the value), but I am not sure what the property is in the Explorer object that actually contains the contents of the text.

Does anyone have any suggestions?
0
Comment
Question by:bbaisley
6 Comments
 
LVL 6

Expert Comment

by:xSinbad
Comment Utility
I think what you are after is "explorer.Document"

Cheers
Marcus
0
 
LVL 2

Expert Comment

by:priya_pbk
Comment Utility
Do you to wish to read the source code of the url? what text do you want to read?

-priya
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
Customize this example:

http://www.mvps.org/vbnet/code/internet/urldownloadtofile.htm

Hope this helps
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:bbaisley
Comment Utility
Marcus... I tried the explorer.document option but it never worked. I get an error. Maybe it is trying to take the document before it finished loading? Is that possible, or does it automatically wait until its done?


Priya... I don't care if I take the source code or the text on the page. Actually, the page I want it to store into the variable usually only contains just a line or two, so I really don't mind having to sift thru it.
0
 
LVL 6

Accepted Solution

by:
xSinbad earned 25 total points
Comment Utility


Try this;


Dim explorer As Object, strH as string
Set explorer = CreateObject("InternetExplorer.Application")

explorer.navigate "http://www.microsoft.com"
Do While explorer.busy
Loop

strH = explorer.document.body.innerHTML
Text1.Text = strH ' Place html into a multiline text box
0
 

Author Comment

by:bbaisley
Comment Utility
Thanks.... That worked perfectly!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA Check for Character 9 69
Problem to delete range 4 54
Extract Data and filename Macro 20 98
VBA filters 2 37
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now