Skip to main content

Open-File-Dialog

Command Description

Pop up an open file dialog box

Command Prototype

sRet = Dialog.OpenFile(sDefaultPath,sFilter,sTitle)

Parameter Description

ParameterRequiredTypeDefaultDescription
sDefaultPathTruepath'''C:\Users'''Locate to default directory when dialog displays. Locate to the directory of last operation if null
sFilterTruestring"Text Documents (*.txt)*.txt
sTitleTruestring"Laiye RPA"Dialog title

return

sRet,The variable used to save the output of the command.

Demo

Dim   sRet 
sRet = Dialog.OpenFile('''C:\Users''',"Text document (txt, log)|*.txt;*.log|Any file|*","This is the dialog title" )
TracePrint (sRet)
/**
The output result is the file path selected by the user to open
For example:
sRet = "C: \ uibot \ test_5.6.0 \ log \ 20220125181620.log"
*/