VB6: Copying the entire contents of the webpage to the clipboard - Printable Version +- Antwise community forums (https://forums.antwise.com) +-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11) +--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12) +--- Thread: VB6: Copying the entire contents of the webpage to the clipboard (/showthread.php?tid=135) |
VB6: Copying the entire contents of the webpage to the clipboard - MrPrzemek - 2022-10-04 I need to copy the contents of the page. Using Webbrowser control (IE11) in VB6, I copied the content this way: Code: 1. Webbrowser1.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT The above code selects the entire page (equivalent to Ctrl+A), then copies the entire page to the clipboard (Ctrl+C) and finally deselects the selection. Could you point out how to copy the content using AntView ActiveX? Your RequestCurrentHtml method works great and retrieves the source HTML code. Is it possible to add a method to copy the content of the page? Best Regards Przemek RE: VB6: Copying the entire contents of the webpage to the clipboard - wila - 2022-10-04 Hi Przemek, Do you want the Html or the Text? If you only want the text then you could use javascript along the lines of: Code: Dim jScript As String Then on the raised event retrieve decode the json object to remove the url encoding. Code: Private Sub Document_OnRunAnonymousFunction(ByVal Id As Long, ByVal Params As Variant, ByVal Data As String, ByVal Error As Long) I think that should be it. Once you have the text you can add it to the clipboard in the host application. There's no need to do that from within the browser control as the clipboard is global to the Windows session. If you have a bit I can add the above as a function to the document control similar to the currentHtml one to make it a bit easier to use. -- Wil RE: VB6: Copying the entire contents of the webpage to the clipboard - MrPrzemek - 2022-10-04 (2022-10-04, 08:49:50)wila Wrote: Hi Przemek, Thank you for the tip. I will check it soon. On the other hand, my intention was to copy the whole content I mean both text and images at one time. However, adding the CurrentText method seems like a good idea for copying text. It would be great if you could add such a method in the near future -- Przemek RE: VB6: Copying the entire contents of the webpage to the clipboard - wila - 2022-10-04 Hi, The Document CurrentText method is in the private build I send to you earlier today. Getting both text and images is a different story. I had done some preliminary work on that in the past, via the OnWebResourceResponseReceived event, but bumped into stability issues. So -for now- that did not make it. Will have to look into that again, but no promises yet on when that will be. There might be alternative ways for that, let me think about it for a bit. -- Wil |