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

FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500

P: 2
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',ar gs2);
end;

I am running this on winXP and form v 6i, OpenOffice 2.2.
Jul 18 '07 #1
Share this Question
Share on Google+
1 Reply


P: 2
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.fra me.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 :(
Jul 19 '07 #2

Post your reply

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