Solved

activex (word) in java

Posted on 2001-07-20
7
525 Views
Last Modified: 2011-09-20
Hi, I'm not sure if this is the right topic area, but here goes.... (this question was origonally in the VB section)

I have a Word 8.0 activex component & using a toolkit I've created some java wrapper classes for it.



I'd like to use these to load up a word document inside a java app by using activex calls through these

wrapper classes.

Does anyone know how I can load a word doc using acivex.  I can load the word application, but havn't seen how to load a doc yet.....

any help or pointers would be brilliant (even if it's just directing me to a better topic area to ask the question in)

Thanks for any help,

TimB


Question History
Comment  
From: CJ_S  Date: 07/19/2001 02:54AM PST  
Simple:

Set wordApp = GetObject("Word.Application")
wordApp.Documents.Open "thedoc.doc"
wordApp.Show  
Comment  
From: VincentLawlor  Date: 07/19/2001 03:25AM PST  
The syntax is

Dim objDoc as Object
Set objDoc = CreateObject("Word.Document")
objDoc.Documents.Open "Name of file.doc"
objDoc.Show

I tried this from a VB project it didn't work.

Vin.
 
Comment
From: TimB  Date: 07/19/2001 04:20AM PST  
Hi!

Thanks for your replies,

I've tried:

com.gensym.com.beans.word.Application app = new com.gensym.com.beans.word.Document().getAxApplication();

to get the application.  

The member 'Documents' does not appear to be in this class though...

Alternatively, if I come in from the document side by:

com.gensym.com.beans.word.Document thisDoc  = new com.gensym.com.beans.word.Document();

thisDoc can't see the Documents class or member.


I guess I'm probably doing something wrong, and either instanciating something in the wrong order -
or have my class hirachy mixed up somewhere...?


Which containrt can I use to add to a java JPanel?  every time I instantiate a word object, it seems
to load up an instance of office.  Is it 'TextFrame' or would you reccomend using a different class.

Sorry if my response is a bit jumbled.... I'm pretty sure I can make the same AX calls as VB though..
I just don't really use VB though,

Thanks

TimB  
Comment  
From: CJ_S  Date: 07/19/2001 04:22AM PST  
Maybe you should post a link to this question in the java topic area.

regards,
CJ  

Comment
From: TimB  Date: 07/20/2001 01:44AM PST  
Here's the code I've used:



public com.gensym.com.beans.word.Document getDoc() {
 // theDoc is a pre-defined member variable
 if (theDoc == null) {
   try {
     System.out.println("inside getBrowser!!!");
     ivjtopJPanel.setVisible(true);

     Application app;
     app = getWordApp();
             
     Documents myDocs = new Documents(app);

     // get a reference to the document we want to open
     com.gensym.com.Variant v;
     v = new com.gensym.com.Variant("E:\\Docs\\chord_analysis.doc");
     com.gensym.com.VariantRefParameter vrp;
     vrp = new com.gensym.com.VariantRefParameter(v);

     theDoc = myDocs.Open(vrp);
//      theDoc = new com.gensym.com.beans.word.Document();
     wordApp.show();
   }
   catch(Exception e) {
     e.printStackTrace();
     handleException(e);
   }
 }
 return theDoc;
}


I get a null pointer exception on the line :
  theDoc = myDocs.Open(vrp);
(theDoc does not get created)

can you tell me what I'm doining wrong?  This isn't exactly following your route - I think VB must mask,
of do some of the initialisation for you....

Thanks for ant help,

TimB  
0
Comment
Question by:TimB
[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
7 Comments
 
LVL 1

Author Comment

by:TimB
ID: 6302019
Has anyone loaded an activex component inside a java app before....?
0
 
LVL 1

Author Comment

by:TimB
ID: 6326909
Anyone there...?

Has anyone loaded a word doc inside a java frame?


TimB
0
 
LVL 1

Author Comment

by:TimB
ID: 6335313
Hello.....?
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Expert Comment

by:skullface
ID: 6700185
did u find out how to open a word doc inside a java frame? i am also having the same problem. I am using ibm's bridge2java for manipulating doc files.
if u have found something please give me the link or the resource where i might be able to get some leads.

thankx in advance,
subhro.
0
 
LVL 1

Author Comment

by:TimB
ID: 6714733
I got a set of ActiveX component wrappers created by Gensym in the end.  It's a while ago that I did it now... As far as I remember, it was really easy to create brand new .doc's in the java app, but it was a bit more tricky to load up already existing doc's...

I think the url's www.gensym.com - I was just passed a downloaded set of .jar's by a client, so I don't know if there's any registration and/or payment needed..

bye,


TimB
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6842560
Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, in the event new items have been created since this listing was pulled.

http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20088703.html
http://www.experts-exchange.com/questions/Q.20143374.html
http://www.experts-exchange.com/questions/Q.20154149.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange


P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 6892527
Points refunded and question closed by
Netminder
CS Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

691 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