2014年3月26日 星期三

Access 2007 VBA show “Open File” Dialog

Reference:
http://stackoverflow.com/questions/1091484/how-to-show-open-file-dialog-in-access-2007-vba
http://msdn.microsoft.com/en-us/library/office/ff196794(v=office.15).aspx
http://msdn.microsoft.com/en-us/library/office/ff865284(v=office.15).aspx

    Dim fDialog As Object
    Set fDialog = Application.FileDialog(3)     '3 = msoFileDialogFilePicker
    With fDialog
        .Show
        If (.SelectedItems.Count > 0) Then
            FileName = .SelectedItems(1)
            MsgBox (FileName)
        End If
    End With

沒有留言:

張貼留言