|
-
Feb 8th, 2010, 07:57 AM
#1
Thread Starter
Junior Member
Child page HTML code
Dear all,
Please Save me!
Thanks in Advance
I need a help to get the child page HTML code:
Simply i am using this code to get the HTML code of main (Parent) page.
but if it opens the child page than i don't know how to get the HTML code of this child page ?
Private Sub LoadMainPage()
Dim ResultLoad As String
Dim MyIe As New SHDocVw.InternetExplorer
Dim wbrElm As MSHTML.IHTMLElement
Dim HTMdoc As IHTMLDocument2
Dim myFrame2 As IHTMLDocument2
Dim totalFrame As Integer
MyIe.navigate "TEST.HTML"
MyIe.Visible = True
Set HTMdoc = MyIe.document
Set myFrame2 = HTMdoc
'this shows the Main (parent Page HTML Code)
MsgBox (myFrame2.body.innerHTML)
End sub
Same like that if TEST.HTML opens other Child page as popup(TEST2.HTML) and i need to get the HTML code of that "TEST2.HTML"
Thanks
Raghunath Bhandari.
-
Feb 8th, 2010, 10:36 AM
#2
Re: Child page HTML code
Move the declaration of MyIe into the General Section of the Form Module and declare it WithEvents. Then add code to the DocumentComplete, NavigateComplete2 or NewWindow2 (for popups) events.
A simple example.
Code:
Private WithEvents MyIe As SHDocVw.InternetExplorer
Private Sub Command1_Click()
MyIe.Navigate "c:\TEST.HTML"
MyIe.Visible = True
Do Until Not MyIe.Busy
DoEvents
Loop
End Sub
Private Sub Form_Load()
Set MyIe = New SHDocVw.InternetExplorer
End Sub
Private Sub myIE_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
MsgBox (pDisp.Document.body.innerHTML)
End Sub
-
Feb 9th, 2010, 02:15 AM
#3
Thread Starter
Junior Member
Re: Child page HTML code
Hi Guru,
Thanks for your Quickly Response.
Can you please tell me, if i want the same HTML Code in Button Click than what i need to change the code ?
Thanks
Raghu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|