Getting error when using TimeOut argument with dialog box

L

Larry

I long time ago I asked if there was a way to have a dialog box close
automatically and there didn't seem to be any way to do it. But
recently I heard from WordTips about the TimeOut argument which is like
this:

Dialogs(wdDialogToolsMacro).Show TimeOut:=1000

This displays the Macros dialog box for one second then dismisses it.
But then there is an error message that says:

Runtime error 4101 Illegal Function Call

Any idea why I'm getting the error?

This is with Word 97.

Thanks,
Larry
 
L

Larry

Also, I get a different response with different dialog boxes.

With the Macros dialog box, I get the error, as mentioned. With the
Find dialog box, the TimeOut argument works correctly: the box goes
away after one second and there's no error. But with the Customize
dialog box, nothing happens, the box remains in view.

So, three different dialog boxes, three different behaviors.

Dialogs(wdDialogToolsMacro).Show TimeOut:=1000
Dialogs(wdDialogEditFind).Show TimeOut:=1000
Dialogs(wdDialogToolsCustomize).Show TimeOut:=1000

Larry
 
L

Larry

I can get it to work using Resume Next

On Error Resume Next
Dialogs(wdDialogToolsMacro).Show TimeOut:=1000

But that seems like cheating. :)

Larry
 

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