Warning: This Help page is relevant to LibreOffice up to version 6.0.
For updated Help pages, visit https://help.libreoffice.org.

FileExists Function [Runtime]

From LibreOffice Help
Jump to: navigation, search

Determines if a file or a directory is available on the data medium.

Syntax:

FileExists(FileName As String | DirectoryName As String)

Return value:

Bool

Parameters:

FileName | DirectoryName: Any string expression that contains an unambiguous file specification. You can also use URL notation.

Error Codes

5 Invalid procedure call

Example:

sub ExampleFileExists

msgbox FileExists("C:\autoexec.bat")

msgbox FileExists("file:///d|/bookmark.htm")

msgbox FileExists("file:///d|/private")

end sub