Framework EDI Reference. Events
ediDocument. DirChangeNotify

The event handler that gets called when a change has occurred in a directory (and its subdirectories).

Syntax: 

Parameters:

Example:

The following example shows how to get notifications regarding changes detected in a monitored directory.

' Set up FREDI to receive events in the module
Private WithEvents m_oEdiDoc As Fredi.ediDocument
         :
   ' In the main routine start an instance of FREDI
   Set m_oEdiDoc = New Fredi.ediDocument

         :

         :

' This is an event handler for DirChangeNotify that captures all changes detected
' on a monitored folder.
Private Sub m_oEdiDoc_DirChangeNotify(ByVal DirChgType As Fredi.DirChangeIDConstants, ByVal sFileName As String, ByVal sDescription As String)

Select Case DirChgType
Case DirChange_AttributeChange
Debug.Print "Attribute changed"
Case DirChange_CreateTimeChange
Debug.Print "Create time changed"
Case DirChange_FileAdded
Debug.Print "File added changed"
Case DirChange_FileRemoved
Debug.Print "File removed changed"
Case DirChange_FileSizeChange
Debug.Print "File size changed"
Case DirChange_LastAccessChange
Debug.Print "Last access changed"
Case DirChange_LastWriteChange
Debug.Print "Last write changed"
End Select

txtNotification = txtNotification & Trim(sFileName) & ": " & Trim(sDescription) & vbCrLf
End Sub