M
Marion
I have an Oracle application that displays a word document from the Help
button. My code works fine with Word 2003 but in Word 2007, the Word
application is activated but the document is not displayed.
Here is the code that works with Word 2003 but not Word 2007. In Word 2003
the Open works with the argument list but I was hoping to define the
parameters and invoke the Open without the argument list.
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');
OLE2.SET_PROPERTY(docs_obj, 'FileName', fname);
OLE2.SET_PROPERTY(docs_obj, 'ReadOnly', 'True');
OLE2.SET_PROPERTY(docs_obj, 'Visible', 'True');
OLE2.SET_PROPERTY(docs_obj, 'Format', 'wdOpenFormatAllWord');
ole2.invoke(docs_obj, 'Open'); -- open document in read_only mode
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;
Any ideas would be appreciated
button. My code works fine with Word 2003 but in Word 2007, the Word
application is activated but the document is not displayed.
Here is the code that works with Word 2003 but not Word 2007. In Word 2003
the Open works with the argument list but I was hoping to define the
parameters and invoke the Open without the argument list.
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');
OLE2.SET_PROPERTY(docs_obj, 'FileName', fname);
OLE2.SET_PROPERTY(docs_obj, 'ReadOnly', 'True');
OLE2.SET_PROPERTY(docs_obj, 'Visible', 'True');
OLE2.SET_PROPERTY(docs_obj, 'Format', 'wdOpenFormatAllWord');
ole2.invoke(docs_obj, 'Open'); -- open document in read_only mode
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;
Any ideas would be appreciated