Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acrobat OLE automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00625352
Message ID:
00625432
Views:
18
>Hi,
>
>Can anyone guide me Acrobat automation from VFP?
>I am trying to have a pdf document opened in Acrobat, with a test for failure is Acrobat is not installed.
>
>TIA

You should be able to test to see if Acrobat is installed using this code:
#DEFINE HKEY_CLASSES_ROOT -2147483648

loRegistry = NewObject('Registry', HOME() + 'FFC\Registry.vcx')
lcValue = ''

lcClassID = '{CA8A9780-280D-11CF-A24D-444553540000}'
loRegistry.GetRegKey('', @lcValue, ;
                     'CLSID\' + lcClassID + '\InProcServer32', ;
                     HKEY_CLASSES_ROOT)
IF EMPTY(lcValue)
   * It isn't registered, it must not be installed

   MESSAGEBOX("Not Registered")
ELSE
   MESSAGEBOX("Registered!")  
ENDIF
This code actually checks to see if the PDF ActiveX control is installed (which happens when you install Acrobat), so it should work OK.

If you just need to launch the PDF (ie. don't need control over Acrobat, just need to view them), you can use:
loShell = NewObject("_ShellExecute", HOME() + "FFC\_environ.vcx")
loShell.ShellExecute("NameOfPDF.PDF", "C:\DirectoryWherePDFExists\")
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform