Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adobe Acrobat document
Message
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00794952
Message ID:
00795037
Views:
24
Hi Rex,

You can use FindExecutable Win API to get program associated with PDF files and act accordingly.
DECLARE INTEGER FindExecutable IN Shell32;
  STRING lpFile, STRING lpDirectory, STRING @lpResult

lcfile = ADDBS(SYS(2023)) + SYS(2015) + ".PDF"
STRTOFILE("TEMP FILE", lcfile)
lcbuffer = SPACE(200)
lnresult = FindExecutable(lcfile, "", @lcbuffer)
ERASE (lcfile ) 
lcExe = ""
DO CASE
CASE lnresult = 31
	* No program is associated with PDF files	
CASE lnresult < 32
	* Some other error 
OTHERWISE	
	* Extract executable associated with PDF file
	lcExe = LEFT(lcBuffer, RAT(CHR(0), lcbuffer )-1)
ENDCASE
? lcExe
>Hi Sergey,
>
>Thank you most sincerely. What you sent me works perfectly!!
>
>In case my user doesn't have Adobe Acrobat Reader on their system, will you please advise me if you know of a way of checking if the reader is loaded onto the users machine?
>
>Regards...Rex
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform