Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launching Adobe Acrobat
Message
 
To
12/01/2005 10:15:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00976402
Message ID:
00976410
Views:
9
>The name of an Adobe Acrobat file (withouth the extension) is recorded in the field DATA.FILENAME data type numeric.
>I want to launch Acrobat with the file open in Acrobat. If I know the filename the code that works is:
>! /n C:\Program Files\Adobe\Acrobat 5.0\Acrobat\acrobat.exe C:\data\testreport.pdf
>
>Why doesn't this work?:
>! /n C:\Program Files\Adobe\Acrobat 5.0\Acrobat\acrobat.exe 'C:\data\'+str(data.filename)+'.pdf'
>
>Acrobat launches, but tells me the file is not found.
>Thanks

Why You not use ShellExecute instead? You don't need to know Where Acrobat Readed is installed?
   DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
                                               STRING cOperation,;
                                               STRING cFileName,;
                                               STRING cParameters,;
                                               STRING cDirectory,;
                                               INTEGER nShowWindow
    result = ShellExecute(0, 'Open', 'C:\data\'+str(data.filename)+'.pdf' , '', '', 1)
    DO CASE
       CASE result ==  0	     && The system is out of memory or resources.
            msg = The system is out of memory or resources.
       CASE result ==  2	     && Bad Association (for example, invalid URL)
            msg =  "Bad Association (for example, invalid URL)"
       CASE result == 29	     && Failure to load application
            msg = "Failure to load application"
       CASE result == 30	     && Application is busy 
            msg = "Application is busy "
       CASE result == 31         && No application association
            msg = "No application association for PDFs"
   ENDCASE
   IF INLIST(result, 0, 2, 29, 30, 31)
      GetMessage(msg, 0 + 64, "Warning")
   ENDIF
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform