SAMPLE: How to Automate Word 8.0 from JavaLast reviewed: January 29, 1998Article ID: Q169802 |
The information in this article applies to:
SUMMARYThe Jword8.exe sample illustrates how to automate Word 97 from a Java application. This sample shows how to invoke Word 97, make it visible, and open up an existing Word Document. It also PrintPreviews the document and Prints it. It uses the Open, PrintPreview, and PrintOut methods of Word 97. The following file is available for download from the Microsoft Software Library:
~ Jword8.exe (size: 29766 bytes)For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online Services MORE INFORMATION
Overview of Jword8.exeThis sample illustrates how to call a COM object like Word 97 from Java. It shows how you can invoke Word 97, make it visible, and open an existing Word 97 document. It also PrintPreviews and Prints the document. It makes use of the methods like Open, PrintPreview and PrintOut and properties like putVisible of the Word 97 Type Library.
How to Use Jword8.exe
SecurityCOM components can get access to any system resources. As such, they are both very powerful and potentially very dangerous. In the Java Virtual Machine (VM) in Microsoft Internet Explorer 3.x only trusted class files can use COM components. Class files from digitally signed CAB files are trusted. If the HTML file is run from Microsoft Developer Studio, the class files are also trusted. This can be very helpful during applet development. However, to deliver your applet to other users, you must put it in a signed CAB file. When it is run as an application, the class file must already be on your machine. When it is run as an applet, the class file may be downloaded to your machine. There is a potential security threat running downloaded software. To run a Java applet that uses COM components, the applet code must be trusted. For more information on trusted class files, see the CabAndSign sample.
Project Files in Jword8.exe
REFERENCESYou can download the SDK for Java 2.0 at http://www.microsoft.com/java/. For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ Keywords : kbsample kbtool JCOM JVM WizardIss Technology : kbInetDev Version : 1.0 1.1 Platform : WINDOWS Solution Type : kbfile |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |