Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open a PDF file?
Message
From
30/09/1998 22:34:14
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00142220
Message ID:
00142656
Views:
29
>>>Hi,
>>>
>>>I would like to know if there is a way to open a PDF file programatically from VFP. They will be stored in a subdirectory on the server. I would prefer to not have the user to down load it and then open it.
>>>
>>>Thanks
>>>Earl
>>
>>If the client has the reader software, you can open it using shellexecute:
>>
>>oShell = CREATEOBJECT('Shell.Application')
>>oShell.Open('f:\mypdffile.pdf')
>
>When I tried this all not much seemed to happen. oShell was created but nothing was visible so I tried oshell.visible = .t. that got me an OLE error. Any suggestions about what I might be doing wrong.

Shell.Application does not have a visible interface. It is an OLE interface to the windows ShellExecute API function. Any file that you open with shellexecute opens with the application that is specified as the default for that file type in the windows registry.

oShell.Open('f:\mywordDoc.doc')

would launch MS Word (if installed) and open the myworddoc.doc.

oShell.Open('http://www.levelextreme.com')

would launch your default web browser and navigate you to UT.

and
oShell.Open('f:\mypdffile.pdf')

Will open Adobe Acro reader to mypdffile.pdf
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform