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

x
?
Solved

WebBrowser control code translate to  IHTMLDocument2 interface code

Posted on 2010-08-31
4
Medium Priority
?
954 Views
Last Modified: 2012-05-10
in vb6 After test below code
Command1_click() 'IHTMLDocument2 interface
Command2_click() 'WebBrowser control
hIE.Url = wIE. LocationURL
The question is :
how to translate below webbrowser control code to IHTMLDocument2 interface code
 wIE.Document.frames(0).Document.documentElement.innerHTML 'This ie contains 2 frame frames(0) and frames(1)
 wIE.Document.frames(1).Document.documentElement.innerHTML '
equal to  
hIE.???.????........?

in other word,
how to write
hIE.???.????.??? .... equal to wIE.Document.frames(0).Document.documentElement.innerHTML

thanks

Private Sub Command1_Click()
a = 198360 'from another program get the ie hWnd to test
  Dim hIE As Object
  Set hIE = IEDOMFromhWnd(a) ' pass
  Print hIE.URL 'ok equal to command2() wIE.LocationUrl
End sub

Private Sub Command2_Click()
Dim dWinFolder As New ShellWindows
Dim wIE As Object
        For Each wIE In dWinFolder
         Print wIE.LocationURL 'equal to hIE.url
       Next
end sub
0
Comment
Question by:daypro
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Surone1
ID: 33567057
try
set hIE =  wIE.Document.frames(1).Document.documentElement.innerHTML
0
 

Author Comment

by:daypro
ID: 33567650
Thanks for the reply
the problem is in some computer ,
the webpage I want can't  get by wIE (webbrowser control)
must use hIE('IHTMLDocument2 interface) to get,
so hIE is independent (hIE can get all the webpage ,but wIE can't get some webpage)
so I can't use   wIE.Document.frames(1).Document.documentElement.innerHTML

just want the same   usage like
to get the same webpage url
in wIE must write wIE. LocationURL(webbrowser control)
in   hIE must write  hIE.Url ('IHTMLDocument2 interface)

if in  wIE  write       wIE.Document.frames(1).Document.documentElement.innerHTML ( tested  ok)
in hIE how to write hIE.????.????.????......?



can
0
 
LVL 28

Accepted Solution

by:
Ark earned 2000 total points
ID: 33572367
IHTMLDocument2 = WebBrowser1.Document
0
 
LVL 28

Assisted Solution

by:Ark
Ark earned 2000 total points
ID: 33572371
PS I mean IHTMLDocument2 equals WebBrowser1.Document
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

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…
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…
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…
Suggested Courses

971 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