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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle can't display document after upgrade to Word 2007

Status
Not open for further replies.

MDHulen

Programmer
Aug 18, 2009
6
0
0
US
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;
 
This wasn't a problem with the code. In 1995 a bugfix had been applied that added a \ to the end of the document that I passed into the fileopen procedure. The \ wasn't a problem in Word 2003 but is in Word 2007. Once I removed the \ the document was displayed. Removing the \ also worked for Word 2003.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top