回答編集履歴

1

tuiki

2021/07/01 04:26

投稿

yambejp
yambejp

スコア116724

test CHANGED
@@ -25,3 +25,45 @@
25
25
  wscript test.vbs
26
26
 
27
27
  ```
28
+
29
+ # 追記
30
+
31
+ IEが開いていたらそちらを利用する
32
+
33
+ ```VBScript
34
+
35
+ Dim ie
36
+
37
+ set ie=Nothing
38
+
39
+ Dim obj
40
+
41
+ For Each obj In CreateObject("Shell.Application").Windows
42
+
43
+ If TypeName(obj.Document) = "HTMLDocument" Then
44
+
45
+ Set ie = obj
46
+
47
+ Exit For
48
+
49
+ End If
50
+
51
+ Next
52
+
53
+ If ie Is Nothing Then
54
+
55
+ Set ie = CreateObject("InternetExplorer.Application")
56
+
57
+ end if
58
+
59
+ ie.Visible = True
60
+
61
+ ie.navigate2 "https://www.google.com"
62
+
63
+ wscript.sleep 3000
64
+
65
+ ie.navigate2 "https://www.yahoo.co.jp"
66
+
67
+
68
+
69
+ ```