OpenDocument
From Free Pascal wiki
Definition
Unit: Lazarus lclintf
function OpenDocument(APath: String): Boolean;
Official documentation: [1]
Description
opendocument opens a document/file with the default viewer/editor registered with the operating system for that file/file extension. E.g. on Windows, the code will use the registry to look up the file association for the extension.
Warning: On Windows at least in stable version (currently 1.0.6), trying to open documents with spaces in it will not work. This has been fixed in trunk (r36934) and it will probably be merged to 1.0.8. (See bug 21659 in the bugtracker)
Example
uses
...
lclintf
...
OpenDocument('readme.pdf');