It is necessary to save the image from the page opened in Webbrowser, I found the following solution:

var body, imgs, controlRange: olevariant; begin body := wb1.OleObject.document.body; imgs := wb1.OleObject.document.images.item(i);//нужный img controlRange := body.createControlRange; controlRange.add(imgs); controlRange.execCommand('Copy', False, EmptyParam);//копируем if ClipBoard.HasFormat(CF_BITMAP) then begin img1.Picture.Bitmap.LoadFromClipboardFormat(cf_BitMap, ClipBoard.GetAsHandle(cf_Bitmap), 0);//вставляем Clipboard.Clear;// очищаем буфер end; end; 

on line

 controlRange.add(imgs); 

gives:

"Method 'add' not supported by automation object"

How to make this code work? OS Windows 7, IE 11.

Can someone tell me another solution, how to save the picture?

  • one
    That is, you copied the code from where, and you want to bring it to a working state? Option to read the documentation and understand you are not considering? - VladD
  • Well, it would be nice if you suggested a solution, unless of course you know what the problem is! Or you can only direct criticism? If I could figure it out on my own, I probably wouldn't have asked for help! - stud
  • 3
    You see what's up. If we rewrite everything entirely for you to work, then you will not learn anything and will not become a more experienced specialist. This is bad. And we do not want you bad, and therefore do not do the work for you. - Nick Volynkin
  • Thank you for your concern =) However, I don’t ask you to rewrite the code. Just can I tell you something? So far, only two empty, meaningless comments .... - stud
  • It would be helpful if you had remembered the OS version and InternetExplorer. On IE9 works. - Nofate

0