> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 打开选择文件对话框

## 指令说明

**描述：** 弹出对话框，让用户选择目标文件并点击确认，返回用户选择的文件路径

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-01.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=b9e10c495037764198edeca61c638efa" alt="打开选择文件对话框指令参数面板" width="654" height="447" data-path="helpcenter/commands/others/images/showopenfilecommand-01.png" />

    | 参数        | 说明                                                                                                                       |
    | --------- | ------------------------------------------------------------------------------------------------------------------------ |
    | **对话框标题** | 请输入对话框的标题，显示在对话框窗口的左上角，非必填，不填则默认为“请选择文件”                                                                                 |
    | **文件类型**  | 请选择限制可选的文件类型，选项如下图所示，支持自定义文件类型。该参数下方有个“允许多选”的勾选框，不勾选，则用户只能选择单个文件，返回文件路径文本；若勾选，用户可以选择多个文件，返回文件路径列表                        |
    | **自定义类型** | 请输入符合文件类型过滤描述的文本，使用\|分割，前面为显示的描述文字，后面为文件类型，可以多组（该参数在文件类型选择“自定义”时才需填写）。例如：图像文件(*.bmp, *.jpg)\|*.bmp;*.jpg\|所有文件(*.*)\|*.* |
    | **初始目录**  | 请选择对话框显示时定位到的默认目录，不填则定位到上次操作的目录。该参数下方有个“检查文件是否存在”的勾选框，若勾选，用户只能选择已经存在的文件路径，不勾选则用户可以输入不存在的文件                               |
  </Tab>

  <Tab title="高级">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-02.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=4439e1ee5f41b76405bf351ac6d20cac" alt="打开选择文件对话框高级参数面板" width="656" height="293" data-path="helpcenter/commands/others/images/showopenfilecommand-02.png" />

    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-04.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=e30dea0f018f609f6ed7aac050763d54" alt="打开选择文件对话框使用示例" width="848" height="101" data-path="helpcenter/commands/others/images/showopenfilecommand-04.png" />

**该流程执行逻辑：**

1. 在【打开选择文件对话框】中将标题设置为“请选择文件”，并把可选文件类型限制为 Excel 文件。
2. 运行后，流程弹出系统文件选择窗口并等待用户选择文件。
3. 用户确认后，所选 Excel 文件路径保存到结果变量，供后续【启动Excel】或文件处理指令使用。

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-03.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=c798aa3b27a11e4d49360e9cc25a6ac4" alt="打开选择文件对话框效果展示" width="283" height="249" data-path="helpcenter/commands/others/images/showopenfilecommand-03.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-05.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=3e49d6876ef7f28e889e21c6ac1c4682" alt="打开选择文件对话框效果展示" width="1013" height="525" data-path="helpcenter/commands/others/images/showopenfilecommand-05.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/others/images/showopenfilecommand-06.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=841517ead68190fa198c497a96fc535d" alt="打开选择文件对话框效果展示" width="839" height="133" data-path="helpcenter/commands/others/images/showopenfilecommand-06.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
