Solved

WebBrowser control code translate to  IHTMLDocument2 interface code

Posted on 2010-08-31
4
905 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 27

Accepted Solution

by:
Ark earned 500 total points
ID: 33572367
IHTMLDocument2 = WebBrowser1.Document
0
 
LVL 27

Assisted Solution

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

9 Experts available now in Live!

Get 1:1 Help Now