How to open a document in Free Pascal/Lazarus

To open a document file using it’s default application use OpenDocument function that exists in LCLIntf unit:


procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    OpenDocument(OpenDialog1.FileName);
end;

2 thoughts on “How to open a document in Free Pascal/Lazarus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s