Solved

WebBrowser control code translate to  IHTMLDocument2 interface code

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

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

Suggested Solutions

Title # Comments Views Activity
add text to end of existing text in file 16 69
VBA saving file message display 5 56
TT Auto Dashboard 13 80
Help with retrieving partial value from a column using VB.NET 4 39
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

932 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