OpenFileDialog function

Top  Previous  Next

OpenFileDialog returns the string of the path the user has selected using the open file dialog.

 

Syntax

 

 completeFilePath = OpenFileDialog( [filter extension], [file Name], [start path] )

 

Parameters

filter extension

 

extensions to filter, like .exe, .txt or .csv

file Name

 

the file name to suggest

start path

 

the path to set the dialog to start with

 

 

 

return value

 

returns a string containing the complete path the user selected

 

 

The filter extensions are a paired string separated by a |. So "Text Files|*.txt" would display Text Files and show only files ending with .txt.

For multiple extensions for the same display name use a semi colon as in the example below.

"Text Files|*.txt;*.csv"

 

You can set multiple filters such as:

"Text Files|*.txt|CSV Files|*.csv"

 

 

Examples

 

PRINT OpenFileDialog( "Text Files|*.txt;*.csv", "orders.txt", fileManager.DefaultFolder )

PRINT SaveFileDialog( "Text Files|*.txt;*.csv", "orders.txt", fileManager.DefaultFolder )