Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WebBrowser control code translate to  IHTMLDocument2 interface code

Posted on 2010-08-31
4
Medium Priority
?
941 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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…
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…
Suggested Courses

722 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