Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

FileExists Function

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