42laVRyz5iwMFqn7Lx6g7S changeset

Changeset323666363463 (b)
ParentNone (a)
ab
0+Sub test1()
0+       
0+    Dim objShell As Object
0+    Dim strTitle As String
0+    Dim objWindow As Object
0+    Dim strURL As String
0+    Dim objNode As Object
0+   
0+    '参考URL:http://www.htmq.com/html/select.shtml
0+    strTitle = "<SELECT>-HTMLタグリファレンス"     '開いてるページタイトル
0+   
0+    '開いてるウィンドウの特定
0+    Set objShell = CreateObject("Shell.Application")
0+    For Each objWindow In objShell.Windows
0+        If TypeName(objWindow.Document) = "HTMLDocument" Then
0+            If InStr(1, objWindow.Document.Title, strTitle) <> 0 Then
0+                Exit For
0+            End If
0+        End If
0+    Next
0+   
0+    Set objNode = objWindow.Document.getElementsByName("blood")(0)
0+   
0+    objNode.Value = "B"                     '値を指定
0+    'objNode.selectedIndex = 2              'インデックスを指定
0+    'objNode.Options(3).Selected = True     '普通はListBoxなど複数選択で使う
0+   
0+End Sub
...
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
29
30
31
--- Revision None
+++ Revision 323666363463
@@ -0,0 +1,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