Is there a way to make MessageBox automatically deviate after a given time interval?

I have VBScript for warning of an event with a MessageBox, but I would like this to automatically reject after 5 seconds or so. Is there any way to achieve this?

+3
source share
1 answer

Use the WshShell object popup method. It has a timeout parameter.

intTimeout = 10      'Number of seconds to wait
strMessage = "This is my message box!"
strTitle = "Hello, world!"

Set WshShell = CreateObject("WScript.Shell")
intResult = WshShell.Popup(strMessage, intTimeout, strTitle)

For more information, see my article Mastering MessageBox on ASP Free.

+9
source

All Articles