Kbase 43063: Differences in behavior when printing HTML and JPG files from Progress 4GL.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Solution ID: P13063
FACT(s) (Environment):
Windows
SYMPTOM(s):
Using the shellExecuteA Windows API from within a Progress program for printing capabilities.
User must select a printer when passing an HTML file to that Windows API as one of its parameters for printing.
When passing an image file to that API such as a .JPEG, it prints the file directly without asking for user interaction.
CAUSE:
The ShellExecute API does not do the print itself. When using it to do an "open" or "print", try to think of it this way:
open = method to "double-click" the file programmatically
print = method to "right-click, print" the file programmatically
The actual printing is performed by the application associated with the file extension in Windows. This can be viewed/changed by navigating from Windows Explorer: Tools menu, "Folder Options...", File Types tab, select the desired extension under "Registered File Extensions", click Advanced, select Open or Print under "Actions:", click Edit, examine the field "Application used to perform action:".
JPG/JPEG files are usually associated with: Microsoft Photo Editor and the print action for JPG performs:
"C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.EXE" /p "%1"
Whereas, HTM/HTML documents are usually associated with: Internet Explorer and the print action for HTM performs:
"C:\Program Files\Microsoft Office\Office\msohtmed.exe" /p %1
So, as described above, the printing has nothing to do with ShellExecute API, but rather it's dependent on the command line options available in the associated application for that file or document.
FIX:
Make use of other methods to print an HTM/HTML file from within a Progress program. Another approach for this would be the use of ActiveX programming technique.