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:
Option Explicit Private Sub Form_Load() Dim oEle As IHTMLElement, oImgEle As IHTMLImgElement, _ oHTMLDoc As HTMLDocument, oCR As IHTMLControlRange, _ oNavNWait As cX3WebBrowserNavAndWait Set oNavNWait = New cX3WebBrowserNavAndWait Call oNavNWait.navigateAndWait(WebBrowser1, "www.yahoo.com") Set oHTMLDoc = WebBrowser1.Document For Each oEle In oHTMLDoc.getElementsByTagName("IMG") Set oImgEle = oEle If (LCase(oImgEle.alt) = LCase("Validation Image")) Then Set oCR = oHTMLDoc.body.createControlRange() Call Clipboard.Clear Call oCR.Add(oImgEle) If (oCR.execCommand("copy")) Then Set Me.Picture = Clipboard.GetData(ClipBoardConstants.vbCFBitmap) Call SavePicture(Clipboard.GetData(vbCFBitmap), "C:\tmp.gif") End If Exit For End If Next oEle Set oNavNWait = Nothing End Sub





Reply With Quote