Results 1 to 40 of 41

Thread: Saving web page temporarily

Threaded View

  1. #19
    Addicted Member Xiphias3's Avatar
    Join Date
    Jan 2009
    Location
    Clarendon, Jamaica
    Posts
    188

    Re: Saving web page temporarily

    No problem. Navigate to whatever page you need to and debug the code looking at the alt properties and stuff.

    In the Form:
    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Dim oEle As IHTMLElement, oImgEle As IHTMLImgElement, _
    5.         oHTMLDoc As HTMLDocument, oCR As IHTMLControlRange, _
    6.         oNavNWait As cX3WebBrowserNavAndWait
    7.    
    8.     Set oNavNWait = New cX3WebBrowserNavAndWait
    9.     Call oNavNWait.navigateAndWait(WebBrowser1, "www.yahoo.com")
    10.     Set oHTMLDoc = WebBrowser1.Document
    11.    
    12.     For Each oEle In oHTMLDoc.getElementsByTagName("IMG")
    13.         Set oImgEle = oEle
    14.         If (LCase(oImgEle.alt) = LCase("Validation Image")) Then
    15.             Set oCR = oHTMLDoc.body.createControlRange()
    16.             Call Clipboard.Clear
    17.             Call oCR.Add(oImgEle)
    18.             If (oCR.execCommand("copy")) Then
    19.                 Set Me.Picture = Clipboard.GetData(ClipBoardConstants.vbCFBitmap)
    20.                 Call SavePicture(Clipboard.GetData(vbCFBitmap), "C:\tmp.gif")
    21.             End If
    22.             Exit For
    23.         End If
    24.     Next oEle
    25.     Set oNavNWait = Nothing
    26. End Sub
    Last edited by Xiphias3; Sep 11th, 2009 at 04:36 PM.

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