Open a WORD document from Oracle Forms

Posted on 2008-11-20
Last Modified: 2013-12-19
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




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


Open in new window

Question by:caldernet
    LVL 23

    Expert Comment

    Concatenate the executable and the file:
    WINWORD.EXE '||file  
    LVL 1

    Author Comment

    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.
    LVL 23

    Expert Comment

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

    Author Comment

    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_
    LVL 1

    Author Comment

    I read that in 10g, we have to use  WEBUTIL rather than APP_BEGIN.

    If anybody knows how to use it, please speak up.
    LVL 1

    Accepted Solution

    The following is the information I have been able to dig up.
    Because installing WebUtil seems rather difficult and perhaps overkill, I am planning on using the WEB.SHOW_DOCUMENT built in function and hope that works.
    As this is now out of the scope of the original question, I will be closing this issue and refunding my points.
    Thank you very much to all who thought about this and especially to DVZ who contributed.

    Before we will be able to open documents from Oracle Forms, WebUtil will have to be installed. Its an addon for 9.02 and above and I do not believe it is currently installed.

    As 10g is a web-based application, WebUtil provides a collection of tools (Java Beans and an API) which allows the web based application to communicate with the clients computer to perform various tasks including file manipulation.

    I have the following information which may or may not be all that is required in regards to the installation and set up of WebUtil.

    Before WebUtil can be installed, something called the JACOB libraries also need to be installed.

    Software Downloads  (Look for WebUtil)

    FAQ  Oracle Forms 10g - WebUtil  April 2007

    Oracle Forms 10g WebUtil  Production Release

    WebUtil Familiarization Manual

    WebUtil Configuration

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Suggested Solutions

    Article by: Swadhin
    From the Oracle SQL Reference ( we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    This video shows how to recover a database from a user managed backup
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now