<div class="meta" robots="noindex">

</div>

Method

# SelectFolder

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `FolderItem.ShowSelectFolderDialog<folderitem.showselectfolderdialog>` as a replacement.

</div>

## Description

Displays a dialog box similar to the open-file dialog allowing the user to select a folder rather than a file.

## Usage

*result*=**SelectFolder**

| Part   | Type                                | Description                   |
|--------|-------------------------------------|-------------------------------|
| result | `FolderItem</api/files/folderitem>` | The folder the user selected. |

## Notes

The <span class="title-ref">SelectFolder</span> function displays a dialog box similar to the open-file dialog box displayed by the `FolderItem.ShowOpenFileDialog<folderitem.showopenfiledialog>` function. The difference is that the dialog box displayed by the <span class="title-ref">SelectFolder</span> function allows the user to choose a folder rather than a file.

## Sample code

This example displays the name of the folder the user chose.

``` xojo
Dim f As FolderItem
f = SelectFolder
If f <> Nil Then
  MsgBox(f.Name)
End If
```

## Compatibility

All project types on all supported operating systems.

## See also

`FolderItem.ShowOpenFileDialog<folderitem.showopenfiledialog>`, `FolderItem.ShowSaveFileDialog<folderitem.showsavefiledialog>` functions; `SelectFolderDialog</api/user_interface/desktop/selectfolderdialog>` class.
