Revision 323666363463 () - Diff

Link to this snippet: https://friendpaste.com/42laVRyz5iwMFqn7Lx6g7S
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Sub test1()
Dim objShell As Object
Dim strTitle As String
Dim objWindow As Object
Dim strURL As String
Dim objNode As Object
'参考URL:http://www.htmq.com/html/select.shtml
strTitle = "<SELECT>-HTMLタグリファレンス" '開いてるページタイトル
'開いてるウィンドウの特定
Set objShell = CreateObject("Shell.Application")
For Each objWindow In objShell.Windows
If TypeName(objWindow.Document) = "HTMLDocument" Then
If InStr(1, objWindow.Document.Title, strTitle) <> 0 Then
Exit For
End If
End If
Next
Set objNode = objWindow.Document.getElementsByName("blood")(0)
objNode.Value = "B" '値を指定
'objNode.selectedIndex = 2 'インデックスを指定
'objNode.Options(3).Selected = True '普通はListBoxなど複数選択で使う
End Sub