469,898 Members | 1,532 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Calling word application from oracle forms 10g


I am trying to open a word document on the client machine. the document is present on the oracle application server (on windows).

For that I have created a java class file wordbean.class. (Source code below)

package oracle.forms.demos.ole;
import com.jacob.activeX.ActiveXComponent;
import java.awt.Panel;
import com.jacob.com.*;

public class wordbean extends Panel
private ActiveXComponent MsWordApp = null;
private Dispatch document = null;

public void openWord(boolean makeVisible)
//Open Word if we've not done it already
if (MsWordApp == null)
MsWordApp = new ActiveXComponent("Word.Application");
//Set the visible property as required.
Dispatch.put(MsWordApp, "Visible",
new Variant(makeVisible));

created a jar file wordbean.jar. Put it in E:\Dev_Suite1\forms\java
updated the entry for archive_jini parameter in formsweb.cfg :-

archive_jini = jacob.jar,wordbean.jar,frmwebutil.jar

Created a form call_word. Cretaed a bean area ctl.wordbean on canvas on that form (ctl is a block and wordbean is a bean area).

In button click trigger I wrote the following code

FBean.Register_Bean('CTL.WORDBEAN',1,'oracle.forms .demos.ole.wordbean');

But it is not opening the word document.

I got the following error message in the java console :

*** oracle.forms.demos.ole.wordbean Heavyweight bean oracle.forms.demos.ole.wordbean
*** oracle.forms.demos.ole.wordbean Setting mOpenWord$1 to true
*** oracle.forms.demos.ole.wordbean Setting mOpenWord to 0
*** oracle.forms.demos.ole.wordbean Invoking openWord
*** oracle.forms.demos.ole.wordbean Method invocation failed for openWord: java.lang.reflect.InvocationTargetException
*** oracle.forms.demos.ole.wordbean java.lang.ExceptionInInitializerError

Could anyone please assist me that why this error came and hoe to rectify it..


Thanks in advance..

Anuj Singhal

Jan 11 '07 #1
0 6767

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Darryl Kerkeslager | last post: by
8 posts views Thread by Rob Kellow | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.