Microsoft KB Archive/209952

= WD2000: Macro Called by Application.OnTime Command Fails to Run =

Article ID: 209952

Article Last Modified on 12/6/2000

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q209952



SYMPTOMS
When you try to call a macro using the Application.OnTime command, the macro does not run as expected.



CAUSE
This behavior is by design. If the macro containing the OnTime command is stored within one of the following:


 * A document level module, instead of a global module such as may be found in the Word default template, Normal.Dot,

-or-


 * An attached template

-or-


 * An add-in

and the active document is a document other than the document containing the procedure that executes the OnTime command, the called macro will not run.



WORKAROUND
To work around this problem, do one of the following:
 * Place the macro containing the OnTime command in a module in the Word default template, Normal.dot.

-or-


 * Place the macro containing the OnTime command in a module in a template common to both documents.

-or-


 * Incorporate the OnTime command and related commands within a Word add-in.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
For more information about add-ins, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type add-ins in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

