Link to home
Start Free TrialLog in
Avatar of caldernet
caldernetFlag for Canada

asked on

Open a WORD document from Oracle Forms

How do I open an existing document (WORD .doc, Excel .xls, PDF etc.) from Oracle Forms 10g?

I want to be able to open a document sitting in a folder somewhere on the netword when I click a button in Oracle Forms 10g.

To make this simple, I'll assume this is a WORD document and the location of WINWORD.EXE and the document I want to open will be hard-coded.

The attached snippet shows code I obtained elsewhere which I put into a trigger on a button on my form. I readelsewhere  that 10g, being web-based may require an additional API like webutil or something, but I cannot find anything clear to me.

When run in my form, it gives the following error:
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-106561

declare
AppID PLS_INTEGER;
begin
AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office11\WINWORD.EXE c:\files\oui.pdf',DDE.APP_MODE_NORMAL);
end;

Open in new window

Avatar of David VanZandt
David VanZandt
Flag of United States of America image

Concatenate the executable and the file:
WINWORD.EXE '||file  
Avatar of caldernet

ASKER

Both of the following lines in my snippet caused the same error as the original.

AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office11\WINWORD.EXE' || 'c:\temp\document.doc',DDE.APP_MODE_NORMAL);

AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office11\WINWORD.EXE || c:\temp\document.doc',DDE.APP_MODE_NORMAL);

Note: In my original message, I try to open a PDF document with WINWORD. That was in error. Opening a WORD document causes the same problem. Sorry for any confusion.
Sorry, to clarify:
AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office11\WINWORD.EXE' || c:\temp\document.doc, DDE.APP_MODE_NORMAL);
I'm sorry - But generated the form gives the following error:

Compiling WHEN-BUTTON-PRESSED trigger on BUTTON_VIEW_DOCUMENT item in CONTROL data block...
Compilation error on WHEN-BUTTON-PRESSED trigger on BUTTON_VIEW_DOCUMENT item in CONTROL data block:
PL/SQL ERROR 103 at line 5, column 85
Encountered the symbol ":" when expecting one of the following:

   . ( ) , * @ % & | = - + < / > at in is mod remainder not rem
   => .. <an exponent (**)> <> or != or ~= >= <= <> and or like
   as between from using || member SUBMULTISET_
I read that in 10g, we have to use  WEBUTIL rather than APP_BEGIN.

If anybody knows how to use it, please speak up.
ASKER CERTIFIED SOLUTION
Avatar of caldernet
caldernet
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial