Microsoft로 로그인
로그인하거나 계정을 만듭니다.
안녕하세요.
다른 계정을 선택합니다.
계정이 여러 개 있음
로그인할 계정을 선택합니다.

적용 대상

응용 프로그램 개체

파일 대화 상자의 단일 인스턴스를 나타내는 FileDialog 개체를 반환합니다.

expression.FileDialog(dialogType)

필수 요소입니다. 적용 대상 목록에 있는 개체 중 하나를 반환하는 식입니다.

dialogType    필수 MsoFileDialogType. 파일 대화 상자의 형식입니다.

MsoFileDialogType은 이러한 MsoFileDialogType 상수 중 하나일 수 있습니다.

msoFileDialogFilePicker

msoFileDialogFolderPicker

msoFileDialogOpen Microsoft Access에서 지원되지 않습니다.

msoFileDialogSaveAs Microsoft Access에서 지원되지 않습니다.

주의

msoFileDialogOpenmsoFileDialogSaveAs 상수는 Microsoft Office Access 2007에서 지원되지 않습니다.

이 예에서는 FileDialog 개체를 사용하여 사용자가 하나 이상의 파일을 선택할 수 있는 대화 상자를 표시하는 방법을 보여 줍니다. 그러면 선택한 파일이 FileList라는 목록 상자에 추가됩니다.

Private Sub cmdFileDialog_Click()
' Requires reference to Microsoft Office 11.0 Object Library.
Dim fDialog As Office.FileDialog
Dim varFile As Variant
' Clear listbox contents.
Me.FileList.RowSource = ""
' Set up the File Dialog.
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
' Allow user to make multiple selections in dialog box
.AllowMultiSelect = True
' Set the title of the dialog box.
.Title = "Please select one or more files"
' Clear out the current filters, and add our own.
.Filters.Clear
.Filters.Add "Access Databases", "*.ACCDB"
.Filters.Add "Access Projects", "*.ADP"
.Filters.Add "All Files", "*.*"
' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then
'Loop through each file selected and add it to our list box.
For Each varFile In .SelectedItems
Me.FileList.AddItem varFile
Next
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With
End Sub

도움이 더 필요하세요?

더 많은 옵션을 원하세요?

구독 혜택을 살펴보고, 교육 과정을 찾아보고, 디바이스를 보호하는 방법 등을 알아봅니다.

커뮤니티를 통해 질문하고 답변하고, 피드백을 제공하고, 풍부한 지식을 갖춘 전문가의 의견을 들을 수 있습니다.

이 정보가 유용한가요?

언어 품질에 얼마나 만족하시나요?
사용 경험에 어떠한 영향을 주었나요?
제출을 누르면 피드백이 Microsoft 제품과 서비스를 개선하는 데 사용됩니다. IT 관리자는 이 데이터를 수집할 수 있습니다. 개인정보처리방침

의견 주셔서 감사합니다!

×