Microsoft Word Suite
302
[tolerance integer] Optional. The maximum time (in seconds) that can elapse before a macro
that wasnt run at the time specified by when is canceled. Macros may not always run at the
specified time. For example, if a sort operation is under way or a dialog box is being displayed,
the macro will be delayed until Word has completed the task. If this argument is 0 (zero) or
omitted, the macro is run regardless of how much time has elapsed since the time specified by
when.
Remarks
Word can maintain only one background timer set by on time. If you start another timer before an
existing timer runs, the existing timer is canceled.
Example
This example runs the macro named "MyMacro" in the current module at 3:55 P.M.
on time when "15:55:00" name "MyMacro"
Command: open as document
Opens the specified template as a document and returns a document object.
Note Opening a template as a document allows the user to edit the contents of the template. This
may be necessary if a property or command (the styles property, for example) isnt available from
the Template object.
Syntax
open as document template Required. An expression that returns a template object.
Example
This example opens the template attached to the active document, displays a message box if the
template contains anything more than a single paragraph mark, and then closes the template.
set aDoc to open as document attached template of active document
if content of text object of aDoc is not return then
display dialog "The template is not empty"
else
display dialog "The template is empty"
end if
close aDoc saving no
This example saves a copy of the Normal template as "Backup.dot."
set aDoc to open as document normal template
save as aDoc file name "Backup.dot"
close aDoc saving no