Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 12-14-2014, 04:39 PM
Charles Kenyon Charles Kenyon is offline How to start a Userform when Word is started Windows 7 64bit How to start a Userform when Word is started Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,453
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by dherr View Post
Thanks for the fast answer!
The code you show me, I have set this accurate into the module of normal.dotm. But it doesn't work.
I get the error message:
Runtime error. 4248
This order is not available, because no document is open.
What's to do?
Greetings-
Dietrich
Here is code to delay the execution of a macro for a given number of seconds.

Code:
Private Sub HaveABreak(iSeconds As Integer)
'
 ' Macro pauses running of procedure for given number of seconds
' Astrid Zeeland
' https://wordmvp.com/FAQs/MacrosVBA/ShowAllClippitAnimations.htm

 '
Dim lPauseTime As Long
Dim lStart As Long
  lPauseTime = iSeconds
  lStart = Timer 'get current time
  Do While Timer < lStart + lPauseTime
    DoEvents
  Loop
End Sub
Put this into the same module that would hold the AutoExec.

You would call it with HaveABreak (i) where i is the number of seconds you need to wait. Try it with 1. Insert the following into the AutoExec macro before the Show command:

HaveABreak(1)

Last edited by Charles Kenyon; 01-28-2023 at 10:11 AM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to start a Userform when Word is started Getting started... Annby Project 3 11-06-2014 03:38 PM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
How to start a Userform when Word is started Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
How to start a Userform when Word is started Page footers have started ravl13 Word 3 11-21-2013 12:31 PM
Need Help Getting Started, Please. Thanks ChunkyZergling Outlook 1 04-24-2009 07:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft