I have an Oracle application that opens a Word document. The following procedure opens the document in Word 2003 but only brings up the Word 2007 application and doesn't display the document in Word 2007.
procedure fileopen (fname in varchar2) is
arglist ole2.list_type;
obj_hnd OLE2.OBJ_TYPE;
docs_obj OLE2.OBJ_TYPE;
begin
obj_hnd := ole2.create_obj('Word.Application');
OLE2.SET_PROPERTY(obj_hnd, 'Visible', 1);
docs_obj := ole2.get_obj_property(obj_hnd, 'Documents');
arglist := ole2.create_arglist;
ole2.add_arg (arglist, fname);
ole2.add_arg(arglist, 1);
ole2.add_arg(arglist, 1);
ole2.add_arg(arglist, 1);
ole2.invoke(docs_obj, 'Open', arglist); -- open document in read_only mode
ole2.destroy_arglist(arglist);
end;
procedure fileopen (fname in varchar2) is
arglist ole2.list_type;
obj_hnd OLE2.OBJ_TYPE;
docs_obj OLE2.OBJ_TYPE;
begin
obj_hnd := ole2.create_obj('Word.Application');
OLE2.SET_PROPERTY(obj_hnd, 'Visible', 1);
docs_obj := ole2.get_obj_property(obj_hnd, 'Documents');
arglist := ole2.create_arglist;
ole2.add_arg (arglist, fname);
ole2.add_arg(arglist, 1);
ole2.add_arg(arglist, 1);
ole2.add_arg(arglist, 1);
ole2.invoke(docs_obj, 'Open', arglist); -- open document in read_only mode
ole2.destroy_arglist(arglist);
end;