Home » Developer & Programmer » Forms » Word and Oracle Forms integration
Word and Oracle Forms integration [message #83172] Mon, 18 August 2003 09:32 Go to next message
Lars O Sjöström
Messages: 25
Registered: May 1999
Junior Member
Anyone who did integration between Forms and MS Word in such a way that you fill in templates in Word? Via the DOT-files in word.
Re: Word and Oracle Forms integration [message #83173 is a reply to message #83172] Mon, 18 August 2003 09:49 Go to previous messageGo to next message
Tom Mcguire
Messages: 3
Registered: March 2002
Junior Member
I have done this but to get it working easily a colleague wrote some VB code to handle the merge. I know it is possible using the OLE package in forms but you would probably have to know word quite well.

The vb code is copyrighted so I'm sorry I can't give it to you.

Regards

Tom Mcguire
Arete Software Ltd
Re: Word and Oracle Forms integration [message #83179 is a reply to message #83172] Tue, 19 August 2003 02:05 Go to previous message
Ankush
Messages: 18
Registered: July 2002
Junior Member
foll. code will help u
on canvas create one radio button name it option, then write foll. code on when button press(create ok button), still u have any problem, pl. let me know

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
if :option = 1 then
message('File selected');pause;
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 Ankush!' into word document
-- OLE2.SET_PROPERTY(MySelection, 'Text', 'Hello Ankush');
copy_region;

-- Save the document to the filesystem as EXAMPLE.DOC
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:DOCSEXAMPLE.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;

elsif :option =2 then
message('printer selected');pause;
elsif :option =3 then
message('screen selected');pause;
elsif :option =4 then
message('Mail selected');pause;
prg_sent_emails('test');

end if;
end;
Previous Topic: insertion point
Next Topic: tree tree tree
Goto Forum:
  


Current Time: Fri Apr 19 21:47:41 CDT 2024