Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening and Displaying PDF Files from Delphi Application

Status
Not open for further replies.

clakerley

Programmer
Nov 30, 2005
17
US
Hello Everyone,

I want to have my application open and display a PDF file when a user makes a menu selection. I know this should be simple, but I cannot find the answer in the Help files.

I don't want any dialog boxes to open for the user to select a file name or to select a program to use to open the file; I simply want my program to open and display the PDF file using the default program associated with PDF files on the system. Isn't there a Windows API procedure that does this already?

Any ideas?

Thanks,

clakerley
 
Code:
var
RetVal: THandle;

RetVal := ShellExecute(Handle, 'open',
        PChar('C:\Filename.pdf'), nil, nil,
        SW_SHOWNORMAL);

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
be sure to include SHELLAPI in the uses clause.

leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top