Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open and Print a PDF file
Message
From
25/04/2005 14:49:39
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00773960
Message ID:
01008186
Views:
27
>>I need to Open and Print a PDF file from VFP. Someone can help me?
>
>You can use ShellExecute API #12636.
DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
>    INTEGER hwnd, ;
>    STRING lpVerb, ;
>    STRING lpFile, ;
>    STRING lpParameters, ;
>    STRING lpDirectory, ;
>    LONG nShowCmd
>
>lcPDFfile = "c:\mydir\myfile.pdf"
>* Open PDF file
>=Shellexecute(0,"Open", lcPDFfile, "","",7)
>* Print PDF file
>=Shellexecute(0,"Print", lcPDFfile, "","",0)
>
An easier way to do this without having to code the DECLARE and all is simply use the FFC class that does this for you (which I wrote for inclusion in VFP7):

oShellExecute=NEWOBJECT("_ShellExecute",HOME()+"FFC\_Environ.vcx")
oShellExecute.shellexecute("c:\mydir\myfile.pdf")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform