Results 1 to 3 of 3

Thread: Child page HTML code

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Location
    Kathmandu, Nepal
    Posts
    23

    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.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Location
    Kathmandu, Nepal
    Posts
    23

    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
  •  



Click Here to Expand Forum to Full Width