Auto dismissing messages

RichS

Healthy software!
Local time
Today, 18:33
Joined
Apr 16, 2008
Messages
44
I wish to use message boxes that pop up when certain options are chosen, that can either be immediately cleared by clicking the 'OK' button or that disappear by themselves after a short period (10 seconds in this case). After searching the net for various options, I found the following code:

Code:
Set objShell = CreateObject("Wscript.Shell")

intReturn = objShell.PopUp("Date of Birth updated", 10, "FYI", 64)

(The 64 displays an information symbol)

The box is displayed correctly and the 'OK' button works fine, but the box does not automatically dismiss when nothing is pressed. Am I missing something?
 
Last edited:
I think you will need to design your own msgbox that looks like a msgbox, but which also includes a timer event to close it.

then anywhere you use msgbox, you need to change that to (eg) mymsgbox, and use your own code.

which is similar to what you are trying to do, I think.
 
Thanks for you comments. The code I had in my original post was supposed to do this, with the value of the time delay included in the parameters. I was mainly curious as to why this didn't work, as it's posted as a solution on several forums.
 
ah. I have never used that. Thanks for the tip

I just tried it, and it worked for me. I think it took slightly more than 10 secs. Maybe 12.


did you dim the object first. I have this, which works fine.

Code:
 Sub test()
Dim objshell As Object
Dim intreturn As Integer
  
 Set objshell = CreateObject("Wscript.Shell")
intreturn = objshell.PopUp("Date of Birth updated", 10, "FYI", 64)
  
 End Sub
 

Users who are viewing this thread

Back
Top Bottom