Solved

Open MS Word with a Java applet.

Posted on 2003-10-30
5
803 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
  • 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 125 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to parse custom JSON to POJO java 4 74
Unhandled exception type Exception 18 31
by zero exception 10 41
How do I remove an object from a 3 27
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

809 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