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

ID: Q209952


The information in this article applies to:
  • Microsoft Word 2000


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 this to be a problem in the Microsoft products 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.


REFERENCES

For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:

Q226118 OFF2000: Programming Resources for Visual Basic for Applications

Additional query words: vba

Keywords : kbdta wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: May 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.