lundi 8 juillet 2019

Read only log files from a folder

I want to read out all log files from this folder but when i try this code there pops up an error wich says: Sub procedure or Function procedure not defined.

Before I add the if then it worked and if I change the if condition to 1=1 it also works.

Sub lst_files_Display

    Dim fullpath

            Dim sFolder
    sFolder = "D:\Berechtigungen"

    Set oFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = oFSO.GetFolder(sFolder)


    For Each ooFile in Folder.Files

    If ooFile.Type Like ".log" Then 
        fullpath = ooFile.Path
        Set fopt = Document.createElement("OPTION")
        fopt.Text = fullpath
        fopt.Title = fullpath
        lst_files.Add fopt
    End If

Next

End Sub

Aucun commentaire:

Enregistrer un commentaire