Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created April 11, 2013 23:09
Show Gist options
  • Save kumatti1/93cf607ba19d1f89ca5e to your computer and use it in GitHub Desktop.
Save kumatti1/93cf607ba19d1f89ca5e to your computer and use it in GitHub Desktop.
Option Explicit
Call hoge
Sub hoge()
Dim ie
Const url = "https://twitter.com/login"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate url
While ie.busy Or ie.ReadyState <> 4
WScript.Sleep (100)
Wend
MsgBox "目的の要素にフォーカスを合わせてください"
Dim obj, e, i
Set obj = ie.document.ActiveElement
MsgBox obj.ID
MsgBox obj.Name
MsgBox obj.Value
MsgBox obj.tagname
If obj.tagname <> "INPUT" Then Exit Sub
For Each e In ie.document.forms
If e Is obj.form Then
MsgBox i & " FormのIndex値"
Exit For
End If
i = i + 1
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment