PC Review


Reply
Thread Tools Rate Thread

Automatically close a message box

 
 
=?Utf-8?B?ZWQ=?=
Guest
Posts: n/a
 
      31st Oct 2006
I need to have a message box (vbokonly) close automatically if it has been
open for longer than 10 seconds.

thanks
 
Reply With Quote
 
 
 
 
bobbo
Guest
Posts: n/a
 
      31st Oct 2006
I think all code execution stops while a message box or input box is
displayed. You could make your own Userform to look like a Msgbox and
use the ontime method to close it after a period of time.

ed wrote:
> I need to have a message box (vbokonly) close automatically if it has been
> open for longer than 10 seconds.
>
> thanks


 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      31st Oct 2006
Here is some code for a timed message box...

'***requires reference to "Windows Script Host Object Model"
Public Sub MessageTest()
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long

Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=10, _
Title:="Hello, World", Type:=vbOKOnly)

End Sub
--
HTH...

Jim Thomlinson


"ed" wrote:

> I need to have a message box (vbokonly) close automatically if it has been
> open for longer than 10 seconds.
>
> thanks

 
Reply With Quote
 
Toby Erkson
Guest
Posts: n/a
 
      31st Oct 2006
Nice Jim!

"Jim Thomlinson" <James_Thomlinson@owfg-Re-Move-This-.com> wrote in message
news:219EBA7B-2B46-4471-860E-(E-Mail Removed)...
> Here is some code for a timed message box...
>
> '***requires reference to "Windows Script Host Object Model"
> Public Sub MessageTest()
> Dim SH As IWshRuntimeLibrary.WshShell
> Dim Res As Long
>
> Set SH = New IWshRuntimeLibrary.WshShell
> Res = SH.Popup(Text:="Click Me", secondstowait:=10, _
> Title:="Hello, World", Type:=vbOKOnly)
>
> End Sub

....


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PPT and Word automatically close with error message Sandy Microsoft Powerpoint 16 21st Sep 2008 11:52 AM
Email message won't close automatically after sending from Adobe? eloises Microsoft Outlook Discussion 11 22nd Jul 2008 09:05 PM
RE: Why does Outlook 2003 close when I close an email message? =?Utf-8?B?cXRpcHMyMg==?= Microsoft Outlook Discussion 0 4th Jan 2007 12:06 AM
Outlook automatically close when Open a Message =?Utf-8?B?Q2hhbXBpb24=?= Microsoft Outlook Discussion 0 16th May 2006 10:10 PM
Pop Up windows close automatically and close all ie browser window =?Utf-8?B?Q3JhenlTaGl0?= Windows XP Internet Explorer 1 22nd Feb 2005 01:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:05 AM.