Home » Developer & Programmer » Forms » how to call an OLE object from developer forms 6i menu option
how to call an OLE object from developer forms 6i menu option [message #80338] Wed, 11 September 2002 13:13 Go to next message
Daniel R
Messages: 8
Registered: September 2002
Junior Member
Hey it's me again, now i need your help in order to call an OLE object from an option of a menu in developer forms 6i, in the documentation I found a function "call_ole_obj...", but it doesn't work for any reason i don't know; so if you can help me i'll aprecciate so much. Tks
Daniel
Re: how to call an OLE object from developer forms 6i menu option [message #80341 is a reply to message #80338] Thu, 12 September 2002 07:08 Go to previous messageGo to next message
SANDY
Messages: 60
Registered: April 1998
Member
This is from oracle web site
This example creates a new Word document, inserts some text in it and saves
its contents into a new file.

DECLARE

-- Declare the OLE objects
MyApplication OLE2.OBJ_TYPE;
MyDocuments OLE2.OBJ_TYPE;
MyDocument OLE2.OBJ_TYPE;
MySelection OLE2.OBJ_TYPE;

-- Declare handle to the OLE argument list
args OLE2.LIST_TYPE;

BEGIN

-- Create the Word.Application object and make Word visible
-- by setting the 'Visible' property to true
MyApplication:=OLE2.CREATE_OBJ('Word.Application');
OLE2.SET_PROPERTY(MyApplication, 'Visible', 1);

-- get a handle on Documents collection
MyDocuments:=OLE2.GET_OBJ_PROPERTY(MyApplication, 'Documents');

-- Add a new document to the Documents collection
Mydocument :=OLE2.INVOKE_OBJ(MyDocuments,'Add');

-- get a handle on Selection object
MySelection:=OLE2.GET_OBJ_PROPERTY(MyApplication, 'Selection');

-- Insert the text 'Hello Word97!' into word document
OLE2.SET_PROPERTY(MySelection, 'Text', 'Hello Word97!');

-- Save the document to the filesystem as EXAMPLE.DOC
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'D:VPURIDOCSEXAMPLE.DOC');
OLE2.INVOKE(MyDocument, 'SaveAs', args);
OLE2.DESTROY_ARGLIST(args);

-- Close the document
OLE2.INVOKE(MyDocument, 'Close');

-- Release the OLE objects
OLE2.RELEASE_OBJ(MySelection);
OLE2.RELEASE_OBJ(MyDocument);
OLE2.RELEASE_OBJ(MyDocuments);
OLE2.RELEASE_OBJ(MyApplication);

END;
Re: how to call an OLE object from developer forms 6i menu option [message #83312 is a reply to message #80338] Fri, 19 September 2003 10:52 Go to previous message
Frank Han
Messages: 2
Registered: November 2002
Junior Member
We have a form 5.0 with OLE container without ole2 program associated. If you right double click the container, you can insert doc, pdf, tif, ecn... documents into the database. If I convert it into 6i and 9i, I have to use program to associate the container (Or item because I can not use named "OLE container" object any more). In your program:

OLE2.ADD_ARG(args, "D:VPURIDOCSEXAMPLE.DOC");

we just can add a certain document to the database by programmer. Do you know how to add a document by a user and the document's name and path will choose by user not by programmer like they did for OLE container?

Thank your help in advance.

Frank Han
Previous Topic: viewing the tab canvas
Next Topic: how to develop a grid form to implement drag & drop columns like toad?
Goto Forum:
  


Current Time: Tue Apr 23 17:47:22 CDT 2024