Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Open MS Word with a Java applet.

Posted on 2003-10-30
5
Medium Priority
?
844 Views
Last Modified: 2012-06-27
How can I start MS-Word from a Java Application Applet? I'm looking for a example.

More specifically, I would like to pass a word macro parameters if it is possible.

We are using mozilla browser and we need to open ms word from an intranet application.

Thanks in Advance.
John
0
Comment
Question by:jtrapat1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9651621
Can you explain what you mean by "Java Application Applet"? Of course an application and an applet are two distinct things normally.
0
 

Author Comment

by:jtrapat1
ID: 9651666
sorry,

I meant java application OR java applet.

john
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 9651731
An applet will have to be signed and an application is not applicable in a browser context. Theoretically, if your Mozilla has a Word plugin, you should be able to set the mime type and have the browser open the Word stuff in-place without using applets.
0
 

Author Comment

by:jtrapat1
ID: 9653276
thanks for the help.
I'm using mozilla 1.5 -
where can i download this word plug-in that you mentioned?

thanks
john
0
 
LVL 2

Expert Comment

by:prcsn1
ID: 9653974
If you need to drive MS Word - a macros or similar, you will have to fire it off through ActiveX. This can be done (though not from an applet, I imagine - the secirty would stop you unless you turned it off).
If you do want to do this it is farly easy to do using Jawin. Some code:

public void init() {
    try {
      Ole32.CoInitialize();
      logger.info("CoInitialise complete");

      app = new DispatchPtr("Word.Application");
      logger.info("opened app");

      app.put("Visible", true);
      logger.info("set visible");
    }
    catch (Exception ex) {
      logger.log(Level.WARNING, "exception during co itialise (ie setting up Word) ", ex);
    }
  }


.... and later, to fire off the macro "mailMergeLoad" with some params

Object o = app.invoke("Run", "mailMergeLoad", templateDir + "\\" + templateFilename);

........... This will work from a Java application, but an applet will have troubles. If all you need is to see MS Word documents, other ways will be easier.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question