Solved

Help with code for using Internet Explorer in my app

Posted on 2002-06-23
6
136 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
Technology Partners: 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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

751 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