By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Calling word application from oracle forms 10g

P: 14
Hi,

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');
FBEAN.SET_LOGGING_MODE('CTL.WORDBEAN',1,FBEAN.LOG_ ALL);
FBean.Invoke('CTL.WORDBEAN',1,'openWord','true');

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..

Please....

Thanks in advance..

Anuj Singhal

(asinghal@techmahindra.com)
Jan 11 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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