Re: Open any file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Scott,
Assuming you have Acrobat Reader or another PDF viewer installed and associated with PDF files, you can use:

declare INTEGER ShellExecute in shell32 INTEGER handle, STRING @ oper, ;
STRING @ ifile, STRING @ iparam, STRING @ ipath, INTEGER showcmd

lcFileName = "c:\temp\document0.pdf"
=shellexecute(0,"open",lcFileName,"","c:\",1)

Rick

"Scott" <Scott@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:286EADF5-0862-4555-88D3-D8BA250FB623@xxxxxxxxxxxxxxxx
Specifically, I want to open a PDF file in Adobe through my application. Now,
normally, because the computer has Adobe Professional on it, I call the Adobe
COM object and open the file that way.

Is there a way to open a file...any file...by calling Windows and just
providing the filename? Windows would then open the file with the appropriate
program.
This would save me always explicitly always using an application's COM
object to open a file.

.



Relevant Pages

  • Re: ShellExecute fails when printing a document.
    ... DECLARE INTEGER ShellExecute; ... String cOperation,; ... > or there is no association for the specified action within the file type" ... > But when seected to open it opens in Microsoft Outlook without a problem. ...
    (microsoft.public.fox.helpwanted)
  • Re: Starting program
    ... LOCAL lnRetval, lcFile, lcOperation ... DECLARE INTEGER ShellExecute IN SHELL32.DLL; ... STRING @sFile,; ...
    (microsoft.public.fox.programmer.exchange)
  • Re: File Type Execution
    ... Declare Integer ShellExecute In shell32 Integer handle, String @ oper,; ... file types. ...
    (microsoft.public.fox.programmer.exchange)
  • Email attachemnt
    ... One of my apps has a command button used for sending an email. ... DECLARE INTEGER ShellExecute; ... STRING cOperation,; ... lcSubject = "Imported Files" ...
    (microsoft.public.fox.helpwanted)
  • Re: sending emails/mailto
    ... Declare Integer ShellExecute In "Shell32.dll"; ... STRING lpVerb,; ... STRING lpFile,; ... >> LONG nShowCmd ...
    (microsoft.public.fox.programmer.exchange)