in a module i have this:
VB Code:
Public Function File_Exists(strFilePath As String) If Dir(strFilePath, vbNormal + vbHidden + vbSystem + vbReadOnly) = "" Then File_Exists = False Else File_Exists = True End If End Function Public Function ShellOpenFile(filepath As String) If (File_Exists(filepath)) Then Shell "notepad filepath", vbNormalFocus Else MsgBox "No such file: " & filepath End If End Function
in my form1, i have this..
VB Code:
Private Sub Command2_Click() ShellOpenFile ("C:\test.txt") End Sub
but it keeps saying that 'filename.txt' doesnt exist![]()
![]()




Reply With Quote