Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with code for using Internet Explorer in my app

Posted on 2002-06-23
6
Medium Priority
?
145 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
ID: 7102732
I think what you are after is "explorer.Document"

Cheers
Marcus
0
 
LVL 2

Expert Comment

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

-priya
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 7102998
Customize this example:

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

Hope this helps
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bbaisley
ID: 7104029
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 100 total points
ID: 7106213


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
ID: 7108913
Thanks.... That worked perfectly!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

773 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