Microsoft KB Archive/125582

= 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