使用msgbox,可以给我们调试脚本带来便利,把需要看到的数值显示出来。但是由于msgbox不能自动关闭,在运行脚本时会比较麻烦。
因此,在我们需要弹出消息窗口的同时,还需要它能够自己关闭,可以使用下面的方法。
Dim res, WSH
Set WSH = CreateObject("WScript.Shell")
'在窗口显示 “Closed after 2 seconds.”
res = WSH.Popup("Closed after 2 seconds.", 2)
Set WSH = Nothing
因此,在我们需要弹出消息窗口的同时,还需要它能够自己关闭,可以使用下面的方法。
Dim res, WSH
Set WSH = CreateObject("WScript.Shell")
'在窗口显示 “Closed after 2 seconds.”
res = WSH.Popup("Closed after 2 seconds.", 2)
Set WSH = Nothing