Created
August 26, 2014 23:01
-
-
Save kumatti1/5be491a6a75ee32457a7 to your computer and use it in GitHub Desktop.
IEでクリックされた要素を調べる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'PublicNotCreatable | |
Public Sub htmlEvent() | |
Attribute hoge.VB_UserMemID = 0 | |
'IHTMLEventObj | |
Dim Win2 As MSHTML.IHTMLWindow2 | |
Set Win2 = IE.document.parentWindow | |
Dim objElement As MSHTML.IHTMLElement | |
Set objElement = Win2.event.srcElement | |
MsgBox objElement.Name | |
End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public IE As Object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Sub UserForm_Initialize() | |
Const url = "https://www.google.co.jp/?gws_rd=ssl" | |
Set IE = CreateObject("Shell.Application").Windows.findwindowSW(url, Empty, 1, 0, 1) | |
If IE Is Nothing Then Exit Sub | |
Dim cls As New Class1 | |
IE.document.onclick = cls | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment