Thanks, Jay.
The url you provided is the exact site from which I obtained the "DoEvents"
code. I'm using the exact same code as below. The only difference is that
it is being called from a regular sub, not something to occur at Word open.
Thanks.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub UserForm_Activate()
DoEvents
' Set the display time in milliseconds
Sleep 5000
Unload Me
End Sub
In a code Module:
Public Sub AutoNew() 'Instead of this, it is just a regular sub
UserForm1.Show
End Sub
> >Can anyone tell me how to create a splash screen that works? I've tried the
> >DoEvents code, and the OnTime code. With DoEvents, I couldn't even get the
[quoted text clipped - 13 lines]
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.
Jay Freedman - 07 Jan 2006 23:52 GMT
Mystery time...
I made a userform in a blank document, using the default name
UserForm1 (since that's what the macro calls), and put only an image
control on it. I pasted your code into the userform code window
without changes. I made a module in the same document and pasted your
macro into it, changing the subroutine name to Foo (my favorite).
Running the macro out of the editor with F5 or from the Macros dialog,
it worked as it's supposed to.
Now I'm wondering what other conditions might be causing your problem.
How is your macro security level set (Tools > Macro > Security)? What
other programs are running? What's on the surface of your userform?
What happens if you stick a MsgBox statement in the userform before or
after the DoEvents? What happens if you replace the DoEvents with
Me.Repaint?
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>Thanks, Jay.
>
[quoted text clipped - 35 lines]
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
zkid - 08 Jan 2006 21:58 GMT
Thanks guys.
The problem, apparently, is that instead of Unload Me, I used Unload
Userform1. Guess it doesn't like that.
Thanks for your responses.
zkid
> Mystery time...
>
[quoted text clipped - 60 lines]
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
Tony Jollans - 08 Jan 2006 00:11 GMT
Where is the procedure you are using instead of AutoNew and how are you
invoking it?
--
Enjoy,
Tony
> Thanks, Jay.
>
[quoted text clipped - 35 lines]
> > Email cannot be acknowledged; please post all follow-ups to the
> > newsgroup so all may benefit.