Table of contents
TOC
折叠目录
展开目录

Application.FileDialog 属性 (PowerPoint)Application.FileDialog Property (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回一个FileDialog对象,该对象表示文件对话框中的单个实例。只读的。Returns a FileDialog object that represents a single instance of a file dialog box. Read-only.

语法Syntax

表达式FileDialog类型expression. FileDialog( Type )

表达式_一个表示应用程序对象的变量。_expression A variable that represents an Application object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
TypeType必需Required文件对话框的类型MsoFileDialogType要返回的对话框的类型。The type of dialog to return.

返回值Return Value

FileDialogFileDialog

注解Remarks

类型参数的值可以是其中一个文件对话框的类型常量。The value of the Type parameter can be one of these MsoFileDialogType constants.

|| |:-----| |msoFileDialogFilePickermsoFileDialogFilePicker| |msoFileDialogFolderPickermsoFileDialogFolderPicker| |msoFileDialogOpenmsoFileDialogOpen| |msoFileDialogSaveAsmsoFileDialogSaveAs|

示例Example

本示例显示另存为对话框。This example displays the Save As dialog box.

Sub ShowSaveAsDialog()

    Dim dlgSaveAs As FileDialog

    Set dlgSaveAs = Application.FileDialog( _
        Type:=msoFileDialogSaveAs)

    dlgSaveAs.Show

End Sub

本示例显示打开对话框,并允许用户选择多个要打开的文件。This example displays the Open dialog box and allows a user to select multiple files to open.

Sub ShowFileDialog()

    Dim dlgOpen As FileDialog

    Set dlgOpen = Application.FileDialog( _
        Type:=msoFileDialogOpen)

    With dlgOpen
        .AllowMultiSelect = True
        .Show
    End With

End Sub

另请参阅See also

概念Concepts

Application 对象Application Object

© 2018 Microsoft