• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 531
  • Last Modified:

activex (word) in java

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
TimB
Asked:
TimB
1 Solution
 
TimBAuthor Commented:
Has anyone loaded an activex component inside a java app before....?
0
 
TimBAuthor Commented:
Anyone there...?

Has anyone loaded a word doc inside a java frame?


TimB
0
 
TimBAuthor Commented:
Hello.....?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
skullfaceCommented:
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
 
TimBAuthor Commented:
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
 
MoondancerCommented:
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
 
NetminderCommented:
Points refunded and question closed by
Netminder
CS Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now