Search code examples
javams-wordoracle10gbusiness-process-managementmodi

Suppress Print Dialog when printing to Microsoft Document Image Writer from Oracle BPM 10g


We have an Oracle BPM 10g activity that:

  1. Reads a form-fill protected Word document template.
  2. Merges data into the fields.
  3. Saves the merged/filled copy to the filesystem.
  4. Prints the document to a selected, pre-defined printer, OR to the default printer.

All of this works fine when printing to a "real" printer. However, there is now a need to output the Word document to TIFF. Attempting to use "Microsoft Document Image Writer" as one of the printer selections does not work as expected. Normally, when printing to the Microsoft Document Image Writer from Word (or any other application) directly, you're prompted for a location to save the resultant file. This prompting does not occur when attempting to print from this particular activity in BPM 10g.

Ideally, we actually would like to bypass the dialog and output the TIFF directly to the filesystem. However, I have not found a way to control this programmatically. That is, being able to specify the destination filename in code. Right now, I'm just trying to get output to the Microsoft Document Image Writer at all, to make sure it works.

So, the bottom line question(s) is/are:

  • Can this be done? I.e., printing to Microsoft Document Image Writer
  • If yes, can the file location dialog be suppressed?
  • How?

Solution

  • Thank you, domke consulting.

    After more searching, I found this forum post on MSDN.

    Adding these registry entries to suppress the dialog box and suppress post-generation output seemed to do the trick:

    In HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\MODI\MDI Writer

    • PrivateFlags = 17 (Decimal)
    • OpenInMODI = 0 (Decimal)

    For our purposes, this seems to work fine if we call the printOut() method with the following relevant arguments (other arguments omitted here for brevity):

    document.printOut(outputFileName : "C:\\temp\\fileName.tif", printToFile : true);