Option Explicit
Dim datFileDate As Date
Dim strTextLine As String
Const filErrorFile As String = "V:\Error\PSSUserErrorLog.dat"
Sub Main()
On Error GoTo MyErrorHandlr
datFileDate = FileDateTime(filErrorFile)
Open App.Path & "\ErrorFile.txt" For Input As #1
Line Input #1, strTextLine
Close #1
If strTextLine = datFileDate Then
If vbYes = MsgBox("You already have seen this file." _
& vbCrLf & "" _
& vbCrLf & "Want to see it again?" _
, vbYesNo Or vbQuestion Or vbDefaultButton2, "Old File") Then
Call ShowErrorFile
End If
Else
Call ShowErrorFile
End If
Exit Sub
MyErrorHandlr:
If Err.Number = 53 Then
'Text File does not exist
Call ShowErrorFile
Exit Sub
End If
End Sub
Private Sub ShowErrorFile()
Dim RetVal
Open App.Path & "\ErrorFile.txt" For Output As #1
Print #1, datFileDate
Close #1
RetVal = Shell("NOTEPAD.EXE " & filErrorFile, 1)
AppActivate RetVal
SendKeys "^{END}"
End Sub