-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodFiler.bas
More file actions
49 lines (31 loc) · 885 Bytes
/
Copy pathmodFiler.bas
File metadata and controls
49 lines (31 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Attribute VB_Name = "modFiler"
Option Compare Database
Option Explicit
Function Filer(fdType As Integer)
'Open a File Dialog to enable user to select a file or folder.
' fdType = 2 : Save As
' fdType = 3 : Select File
' fdType = 4 : Select Folder
Dim fDialog As Office.FileDialog
Dim varItem As Variant
Dim dTitle As String
If fdType >= 2 And fdType <= 4 Then
Set fDialog = Application.FileDialog(fdType)
If fdType = 2 Then
dTitle = "Save File As"
ElseIf fdType = 3 Then
dTitle = "Select File"
ElseIf fdType = 4 Then
dTitle = "Select Folder"
Else
dTitle = ""
End If
With fDialog
.Title = dTitle
If .Show = False Then
Exit Function
End If
Filer = .SelectedItems(1)
End With
End If
End Function