Private Sub Web1_DocumentComplete (ByVal pDisp As Object, the URL As the Variant) 'stay after the page load, and then perform the following statement:
Dim nPath As String, E, nRange
NPath=App. Path & amp; "\ " web icon
Web1. Silent=True 'close interaction to ban script errors Dim s As String For Each E In Web1. Document. All
S=e. agName If e. agName="IMG" Then
The Set nRange=Web1. Document. Body. CreateControlRange ()
NRange. Add E The Clipboard. The Clear NRange. ExecCommand "Copy" Copy to clipboard
SavePicture Clipboard. GetData nPath & amp; "The favicon. BMP" ' saved to the hard disk End the If
Next End Sub
Private Sub Form_Load () Web1. Navigate2 "http://google.com/favicon.ico" End Sub
Want to use this method to get the page icon, when debugging, display SavePicture Clipboard. GetData, nPath & amp; "The favicon. BMP" ' saved to the hard diskError 380, an invalid attribute value, If this method is not used, can use what method according to the web page url to get the icon?
CodePudding user response:
Don't need to use inet control directly download the favicon. Ico is ok,
CodePudding user response:
Can look for local cache file directly and copy to a custom directory,,,,