Programming with Reflection

GetFolderName method

Syntax FolderName = object.GetFolderName([Title], [Text], [StartInFolder])

# Description

Opens a dialog box for selecting a folder, and returns the name of an existing folder selected by the user (without actually opening any files or changing the current folder).

# Arguments

Title Argument type: String
Optional
Specifies the caption to appear in the dialog box title bar. If this argument is omitted, the title "Browse for Folder" is used.

Text Argument type: String
Optional
Specifies descriptive text to appear in the dialog box. If this argument is omitted the text "Currently selected folder:" is used.

StartInFolder Argument type: String
Optional
Specifies the folder which will be selected by default in the dialog box. If this argument is omitted, the Reflection current folder is selected. If the value of this argument does not correspond to an actual folder, the dialog box will match the specified path as closely as possible. For example, if you specify "C:\Folder\Subfolder" and \Subfolder does not exist, the dialog box uses C:\Folder as the starting folder. If \Folder does not exist, the dialog box starts in C:\.

# Return

FolderName Return type: String
The folder name (including drive and path information) the user selects, or an empty string if the user selects Cancel. If the user selects the root folder of a drive, the return value will include a "\" character (for example "C:\"). If the user selects a subfolder, the return value will not include a "\" character (for example "C:\Program Files"). If you are using this method in a procedure, you will need to append this character as needed. If the user browses to a network drive somewhere in Network Neighborhood, the return string is a UNC-format path name. If the network drive is mapped to a drive letter on the PC, the drive letter is used.

Example

Keyword Index

Related Topics

Reflection products that use this command