Solved

Help with code for using Internet Explorer in my app

Posted on 2002-06-23
6
137 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 52

Expert Comment

by:Ryan Chong
ID: 7102998
Customize this example:

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

Hope this helps
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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 25 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

Industry Leaders: 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!

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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
Course of the Month7 days, 17 hours left to enroll

617 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