Hey guys,
I got a program that works fine except I just want the initial directory to be Autosave. I know this is probably easy but I can't seem to figure out how to change it to work here. Can somebody help me out?
Public Function GetFileOpen(Title As String, InitFolder As String, Filter As String) As String
Dim OpenFile As OPENFILENAME
Dim lReturn As Long
Dim sFilter As String
With OpenFile
.hwndOwner = ThisDrawing.hWnd
.lStructSize = Len(OpenFile)
.lpstrFilter = Filter
.nFilterIndex = 1
.lpstrFile = String(257, 0)
.nMaxFile = Len(OpenFile.lpstrFile) - 1
.lpstrInitialDir = InitFolder
.lpstrFileTitle = OpenFile.lpstrFile
.nMaxFileTitle = OpenFile.nMaxFile
.lpstrTitle = "Select File"
.flags = 4
.lpTemplateName = "Test"
End With
'
lReturn = GetOpenFileName(OpenFile)
If lReturn = 0 Then
GetFileOpen = ""
Else
GetFileOpen = Left$(OpenFile.lpstrFile, InStr(OpenFile.lpstrFile, Chr$(0)) - 1)
End If
End Function