Function 測網(url)
On Error Resume Next
cmdping = "ping " & url & " -n 1"
Set oExec = CreateObject("Wscript.shell").exec(cmdping)
Do Until oExec.stdout.AtEndOfStream
strline = strline & oExec.stdout.readline() & Chr(13)
Loop
測網 = 0
If InStr(strline, "回復") Then 測網 = 1
Set oExec = Nothing
End Function
Function 聯網提示(url)
If 測網(url) = 0 Then
tip = Time & " 請確認是否連接上公司內網。"
Debug.Print tip
MsgBox tip
End
End If
End Function