Re: Opening a .pdf file with ShellExecute

Posted by BeckyR on May 21, 2002

Re: Opening a .pdf file with ShellExecute posted by WAllison on May 21, 2002

: : I am having problems opening a .pdf file with the ShellExecute command. The code is:

: : ShellExecute(Handle,'open',PChar'c:\data\gradesheets.pdf'),nil,nil,SW_SHOW);

: : but all that happens when this is executed is the Adobe Acrobat splash screen appears and then closes, and the file is never opened.

: : Any ideas on what I may be missing?

: Try it like this:

: ShellExecute(Handle, PChar('Open'), PChar('c:\data\gradesheets.pdf'),nil , PChar('c:\data'), SW_SHOWNORMAL);

Thanks for the help.

It's weird, when I run it in debug mode it sometimes works, sometimes doesn't, but when I run it staight from the .exe it always works...


Find related articles

Search for:  shellexecute


Related Articles and Replies:


Delphi Forum :: Tutorials :: Source code :: Tips