Solved

WebBrowser control code translate to  IHTMLDocument2 interface code

Posted on 2010-08-31
4
927 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
[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
  • 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 500 total points
ID: 33572367
IHTMLDocument2 = WebBrowser1.Document
0
 
LVL 28

Assisted Solution

by:Ark
Ark earned 500 total points
ID: 33572371
PS I mean IHTMLDocument2 equals WebBrowser1.Document
0

Featured Post

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

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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
Course of the Month7 days, 3 hours left to enroll

622 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