Microsoft Knowledge Base

AppleScript Example: Required Suite

Last reviewed: August 4, 1997
Article ID: Q125582
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 4.0, 5.0, 5.1, 6.0

SUMMARY

This article discusses the following AppleScript events:

   Open
   Print
   Quit
   Run

These events are found in the Required Suite of Word's Event Dictionary.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

MORE INFORMATION

The Required Suite contains events which an application must support in order to work with the system software. System 7.0 was the first operating system to support Apple events. Therefore, to be "System 7.0 friendly," an application must support these four events.

The Open event is used to open document(s) within Microsoft Word. The Print event is used to print Word document(s). The Quit event is used to quit Microsoft Word. The Run event is used to activate Microsoft Word.

Example

The following AppleScript script demonstrates the events listed in the Required Suite. This script does the following:

  1. Activates Microsoft Word.
2. Opens a document named "MyWordFile". 3. Prints the document. 4. Quits the application.

tell application "Microsoft Word"

   run
   open MyWordFile
   print MyWordFile
   quit
end tell


KBCategory: kb3rdparty
KBSubcategory: kbmacroexample
Additional reference words: 4.0 5.0 5.10 6.0 macword word6 Apple script
macword5
Keywords : kbmacroexample kb3rdparty
Version : 4.0 5.0 5.10 6.0
Platform : MACINTOSH


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 4, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.