FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500 [message #252239] |
Wed, 18 July 2007 05:09  |
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   |
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
|
|
|
|
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   |
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
|
|
|
|