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
Solved

Help with code for using Internet Explorer in my app

Posted on 2002-06-23
6
134 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 50

Expert Comment

by:Ryan Chong
ID: 7102998
Customize this example:

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

Hope this helps
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

839 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