Home » Developer & Programmer » Forms » FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500
FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #252239] Wed, 18 July 2007 05:09 Go to next message
the_wickedman
Messages: 4
Registered: July 2007
Junior Member
Hi,

I try to open new OpenOffice document (writer),
But I am getting the exception
FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500

Please help me to resolve this exception.

my code is as follows in when-button-pressed trigger:

declare

App ole2.obj_type;
oDocument ole2.obj_type;
oDesktop ole2.obj_type;
args1 ole2.list_type;
args2 ole2.list_type;
Args ole2.list_type;

begin

App := ole2.create_obj('com.sun.star.ServiceManager');
args1 := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args1,'com.sun.star.frame.Desktop');
oDesktop := OLE2.INVOKE_OBJ(App,'createInstance',args1);

args2 := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args2,'private:factory/swriter');
OLE2.ADD_ARG(args2,'_blank');
OLE2.ADD_ARG(args2,'0');
OLE2.ADD_ARG(args2,Args);

oDocument := OLE2.INVOKE_OBJ(oDesktop,'loadComponentFromURL',args2);
end;


I am running this on winXP and form v 6i, OpenOffice 2.2.

Re: FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #252605 is a reply to message #252239] Thu, 19 July 2007 06:49 Go to previous messageGo to next message
the_wickedman
Messages: 4
Registered: July 2007
Junior Member
I can start Writer using VB Script like this:

'The service manager is always the starting point
'If there is no office running then an office is started up
Set objServiceManager= WScript.CreateObject("com.sun.star.ServiceManager")
'Create the Desktop
Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop")
'Open a new empty writer document
Dim args()
Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter",_
"_blank", 0, args)
'Create a text object
Set objText= objDocument.getText
'Create a cursor object
Set objCursor= objText.createTextCursor
'Inserting some Text
objText.insertString objCursor, "The first line in the newly created text document."&_
vbLf, false

and I can start MS Word, MS Excel using:

DECLARE
app OLE2.OBJ_TYPE;
docs OLE2.OBJ_TYPE;
doc OLE2.OBJ_TYPE;
selection OLE2.OBJ_TYPE;
args OLE2.LIST_TYPE;
BEGIN
-- create a new document
app := OLE2.CREATE_OBJ('Word.Application');
OLE2.SET_PROPERTY(app,'Visible',1);
docs := OLE2.GET_OBJ_PROPERTY(app, 'Documents');
doc := OLE2.INVOKE_OBJ(docs, 'add');
selection := OLE2.GET_OBJ_PROPERTY(app, 'Selection');
-- insert data into new document from long item
OLE2.SET_PROPERTY(selection, 'Text', :POLE_TEKSTOWE5);
-- save document as example.doc
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'd:\example.doc');
OLE2.INVOKE(doc, 'SaveAs', args);
OLE2.DESTROY_ARGLIST(args);
-- close example.doc
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 0);
OLE2.INVOKE(doc, 'Close', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.RELEASE_OBJ(selection);
OLE2.RELEASE_OBJ(doc);
OLE2.RELEASE_OBJ(docs);
-- exit MSWord
OLE2.INVOKE(app,'Quit');
end;

But I can't start Writer from Forms Sad
Re: FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #253179 is a reply to message #252605] Mon, 23 July 2007 01:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David

PS Please format your entries to make then more readable.
Re: FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #253200 is a reply to message #253179] Mon, 23 July 2007 01:56 Go to previous messageGo to next message
the_wickedman
Messages: 4
Registered: July 2007
Junior Member
Hi,

I've not solved my problem yet.
Do you have any suggestions?

With only this line of my code:
App := ole2.create_obj('com.sun.star.ServiceManager');

or
App := ole2.create_obj('com.sun.star.ServiceManager');
args1 := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args1,'com.sun.star.frame.Desktop');
oDesktop := OLE2.INVOKE_OBJ(App,'createInstance',args1);
OLE2.SET_PROPERTY(App,'Visible','true');

in memory I have 2 processes: soffice.exe and sooffice.bin, but Service Manager window is not visible.
With MS Word property Visible (1 or true) gives suspected effect, but no with OpenOffice.

Regards,

Konrad


Re: FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #253431 is a reply to message #253200] Mon, 23 July 2007 20:29 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I googled 'OLE2.SET_PROPERTY app Visible openoffice' and found http://www.developerfood.com/dsoframer-loading-word-document/microsoft-public-office-developer-automation/5d8b0e1b-cc78-47b7-b238-dfc d0788158d/article.aspx

I goggled 'open office api' and found http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html which points to http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.pdf

Unfortunately, I found it a bit hard to read. Have a look around page 970.

Also look at http://weblogs.java.net/blog/tchangu/archive/2005/12/open_office_jav_1.html

All up I think you need to direct your question to http://support.openoffice.org/index.html

David
Previous Topic: Form6 Compile Error (FRM-30021 and FRM-30085 errors)
Next Topic: using LOBs
Goto Forum:
  


Current Time: Fri Sep 27 02:16:43 CDT 2024