Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Const ForReading = 1
content = Result
Set FSO = Nothing
Function Result
Dim List, dlm
Result = 0
If Not FSO.FileExists(FileList) Then
Exit Function
End If
On Error Resume Next
List = FSO.OpenTextFile(FileList, ForReading, False).ReadAll
If Err.Number <> 0 Then
Exit Function
End If
On Error GoTo 0
dlm = vbNewLine
For Each S In Split(List, vbNewLine)
If InStr(1, FSO.GetBaseName(filename), "_" & S & "_", vbTextCompare) > 0 Then
Result = 1
End If
Next
End Function |