Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check if INI file exists
#2
Add this somewhere in a module
Code:
Function FileExist(File As String, FileType As VbFileAttribute) As Boolean
On Error GoTo ErrOut

    If LenB(Dir$(File, FileType)) Then FileExist = True
    Exit Function

ErrOut:

    FileExist = False
    
End Function

Then you can do
Code:
If FileExist(App.Path & "\File.ini", vbNormal) Then

End If

Or.. If it doesnt exist, you can create it like
Code:
If Not FileExist(App.Path & "\File.ini", vbNormal Then

End if
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)