Solved

activex (word) in java

Posted on 2001-07-20
7
514 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
7 Comments
 
LVL 1

Author Comment

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

Author Comment

by:TimB
Comment Utility
Anyone there...?

Has anyone loaded a word doc inside a java frame?


TimB
0
 
LVL 1

Author Comment

by:TimB
Comment Utility
Hello.....?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Expert Comment

by:skullface
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Points refunded and question closed by
Netminder
CS Moderator
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now