Macro AutoExec Programming

T

TheOtherTruth

I need the autoexec macro to wait till after document1 has opened, how do do
this?
 
H

Helmut Weber

Hi,

maybe like this:

Sub autoexec()
Application.OnTime _
When:=Now + TimeValue("00:00:01"), _
Name:="test"

End Sub

Sub test()
If Documents.Count = 0 Then
autoexec
End If
MsgBox "after autoexec"
' your code goes in here
End Sub


Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top