Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to open word documents in Oracle 9i 2

Status
Not open for further replies.

jahaira

Programmer
Oct 10, 2003
4
PR
I have a multi record, when i select one record, i can 'pressed' a button that should open a predifined word document with the data of the record selected. I need to know how to invoke a word document from a button in forms 9i.
 
Hi
Try The Following Code
-------------------------
DECLARE
MyApplication OLE2.OBJ_TYPE;
MyDocuments OLE2.OBJ_TYPE;
MyDocument OLE2.OBJ_TYPE;
args ole2.list_type;
BEGIN
MyApplication := ole2.create_obj('Word.Application') ;
ole2.set_property(MyApplication,'Visible',1);
MyDocuments := ole2.get_obj_property(MyApplication,'Documents');
/* Open a document C:\one.DOC */
args:= ole2.create_arglist;
ole2.add_arg(args,'C:\ans\IT security_06-03.doc');
ole2.add_arg(args,0 );
ole2.add_arg(args,1); --open in Read only mode
Mydocument := ole2.invoke_OBJ(MyDocuments,'Open',args);
ole2.destroy_arglist(args);
args := ole2.create_arglist;
/* Protects the doc with password 'passwd' */
ole2.add_arg(args,2);
ole2.add_arg(args,0);
ole2.add_arg(args,'passwd');
ole2.invoke(Mydocument,'Protect',args);
ole2.destroy_arglist(args);
END;

----------
With Rgds
Ans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top