I can't even recall whether I wrote this or I just copy-lefted from other
folks. It works pretty well though.
===
PROCEDURE OpenPdfFile(pdfFname as String)
LOCAL lcExeFile as String, retVal as Integer, lPath as String
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
DECLARE INTEGER FindExecutable IN shell32;
STRING lpFile,;
STRING lpDirectory,;
STRING @ lpResult
lcExeFile = SPACE(250)
IF UPPER(JUSTEXT(pdfFname)) # "PDF"
= MESSAGEBOX(pdfFname + " has wrong file extension. It should be
<PDF>", 64)
RETURN
ENDIF
lPath = JUSTPATH(pdfFname)
retVal = FindExecutable(pdfFname, "", @lcExeFile)
IF retVal <= 32
= MESSAGEBOX("Not able to find the program to open the pdf file." + ;
" Install <Adobe Reader> first." + ALLTRIM(lcExeFile), 64)
RETURN
ENDIF
lcExeFile = ALLTRIM(lcExeFile)
retVal = ShellExecute(0, "open", lcExeFile, pdfFname, lPath, 2)
RETURN
ENDPROC
====
On Mon, Aug 17, 2009 at 9:40 AM, Brian Abbott <[email protected]>wrote:
> Alan Bourke wrote:
> > Not generating PDF file, mind, just printing an existing one
> > programmatically.
> >
> > Is automating Acrobat Reader an option here? It appears to have been a
> > flaky solution in the past. Or are there any freeware/open source
> > approaches ?
> >
> > TIA
> >
>
>
> ShellExecute works OK for me.
>
>
>
>
>
> --
> Cheers
>
> ============
> Brian Abbott
> ============
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.