[Overview][Types][Procedures and functions][Variables][Index] | Reference for unit 'LCLIntf' (#lcl)

# OpenDocument

Opens the specified document using the default application for the platform or widgetset.

## Declaration

Source position: lclintf.pas line 84

`function OpenDocument(`
`APath: string`
`):Boolean;`

## Arguments

`APath` |  | Full path and file name to open in the routine.

## Function result

True if an application was found and the document was opened.

## Description

OpenDocument is a Boolean function used to open the document specified in APath using the default application for the platform or widget set.

The implementation of OpenDocument is platform- and/or WidgetSet-specific. On Windows, the OpenURL function is called to open the specified document. For UNIX-like platforms, the OpenDocumentWidgetsetImplementation is called when assigned. Otherwise, FindFilenameOfCmd is used to check for common Desktop Environment applications for the platform. RunCmdFromPath is called to open the document using the application.

The return value contains True if an application is available to for the specified file name. The return value is False if an application cannot be found for the specified file, or the file does not exist in the given path.