Solved

Get outertext of page loaded in Internet Explorer

Posted on 2003-11-11
3
276 Views
Last Modified: 2012-06-21
Experts, I don't have time to figure this out, so here's 400 points to anyone that can provide me a good answer with full source code. Here's The situation for which I am in urgent need of a solution: I have one instance of Internet Explorer already running. I want to run a vb program that will capture the outertext of the current page being displayed in that Internet Explorer. The vb program should know which browser to grab it from based on the page title or url.  (I cannot reload that page, as it will feed different results each time--so Inet, browser control, etc, is out of the question).  I simply need to get the contents of a page already loaded in a particular instance of Internet Explorer.  Many thanks in advance!
0
Comment
Question by:John Account
3 Comments
 
LVL 7

Accepted Solution

by:
_agj_ earned 400 total points
ID: 9728560
the following code assumes that u have an instance of IE open and with ur 'WANTED' page open.

Private Sub Form_Load()

Dim ie

Set ie = GetObject(, "InternetExplorer.Application")

'this prints the body part
Debug.Print ie.document.body.innerHTML

'to print the first element (mebbe u cud loop through the items or something if u need)
'Debug.Print ie.document.All.Item(0).innerHTML

Set ie = Nothing

End Sub

this shud giv u the stuff...mostly.
if u want outerHTML or some other element, change suitably.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10537283
Moderator, my recommended disposition is:

    Accept _agj_'s comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

920 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

14 Experts available now in Live!

Get 1:1 Help Now