標題:
[發問]
請問如何同時重新整理全部網頁
[打印本頁]
作者:
donod
時間:
2015-5-1 18:18
標題:
請問如何同時重新整理全部網頁
按F5可以重新整理當前網頁,請問如何同時重新整理全部網頁,謝謝!
作者:
GBKEE
時間:
2015-5-3 11:35
回復
1#
donod
試試看
Option Explicit
Sub Ex()
Dim URL As String
URL = "http://forum.twbts.com/thread-13991-1-1.html"
With CreateObject("InternetExplorer.Application")
.Navigate URL
.Visible = True
Do While .Busy Or .readyState <> 4: Loop
.Refresh '網頁按F5
Do While .Busy Or .readyState <> 4: Loop
End With
End Sub
複製代碼
作者:
donod
時間:
2015-5-3 12:21
回復
2#
GBKEE
謝謝GBKEE版大!
試了,但只會重新開一個指定的網頁,如果要將已經打開的全部網頁,同時重新整理,應如何改寫?
[attach]20859[/attach]
作者:
donod
時間:
2015-5-8 02:20
謝謝GBKEE版大提點!
[attach]20889[/attach]
作者:
GBKEE
時間:
2015-5-8 06:23
回復
4#
donod
試試看
Option Explicit
Dim Ie(1 To 3) As Object, URL(1 To 3) As String
Sub Ex_網頁設立()
Dim i As Integer
URL(1) = "http://forum.twbts.com/thread-13991-1-1.html"
URL(2) = "http://www.miniforum.net/"
URL(3) = "http://www.aastocks.com/tc/LTP/RTQuote.aspx?&symbol=00001"
For i = 1 To 3
Set Ie(i) = CreateObject("InternetExplorer.Application")
With Ie(i)
.Navigate URL(i)
.Visible = True
Do While .Busy Or .readyState <> 4: Loop
End With
Next
End Sub
Sub Ex_網頁重整()
Dim i As Integer
For i = 1 To 3
With Ie(i)
.Refresh '網頁按F5
Do While .Busy Or .readyState <> 4: Loop
End With
Next
End Sub
複製代碼
作者:
donod
時間:
2015-5-8 17:01
謝謝GBKEE版大!
現在可以開3個網頁3個視窗,請教可否在同一個視窗開了多個網頁(如圖),作全部重新整理?謝謝!
[attach]20890[/attach]
作者:
GBKEE
時間:
2015-5-9 16:04
回復
6#
donod
試試看
'請先將專案 [設定引用項目]加入 Microsoft Internet Controls
Option Explicit
Sub IE_F5()
Dim a As New SHDocVw.ShellWindows
Dim shell_windows As New SHDocVw.ShellWindows
Dim Ie As SHDocVw.InternetExplorer
Dim objShell As Object
Set objShell = CreateObject("shell.application")
If objShell.Windows.Count = 0 Then 'Ie 沒有開啟
Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE", 2 ' (2 應用程式視窗會以一個圖示來顯示,並具有駐點)
MsgBox "請等候 ie 開啟完畢"
End If
For Each Ie In shell_windows
With Ie
.Refresh
Do While .Busy Or .ReadyState <> 4: Loop
MsgBox "網址: " & .LocationURL & vbLf & "重整完畢", , Ie.Document.Title
End With
Next
End Sub
複製代碼
作者:
donod
時間:
2015-5-9 18:28
回復
7#
GBKEE
再謝謝GBKEE版大!
因有時會用Google Chrome代替Internet Explorer,請教應如何改寫,謝謝!
作者:
GBKEE
時間:
2015-5-10 08:17
回復
8#
donod
有難度vba 不支援 Google Chrome
作者:
donod
時間:
2015-5-10 11:10
回復
9#
GBKEE
明白了,現在也足夠,感謝GBKEE版大教導!
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)