title image

Smiley Callback-Funktion anbei:
Diese Callback erzeugt eine Liste aller JPG-Dateien im Stammverzeichnis Deiner Festplatte:Public Function ListFiles(ctl As Control, vntID As Variant, _ lngRow As Long, lngCol As Long, intCode As Integer) _ As Variant Dim intCounter As Integer Static sastrFiles() As String Static sintNumFiles As Integer Dim varRetVal As Variant Dim varfile As Variant varRetVal = Null Select Case intCode Case acLBInitialize ' Initialize. With Application.FileSearch .NewSearch .lookin = "C:\" .FileName = "*.jpg" sintNumFiles = .Execute If sintNumFiles > 0 Then ReDim sastrFiles(sintNumFiles) For Each varfile In .FoundFiles sastrFiles(intCounter) = varfile intCounter = intCounter + 1 Next varfile End If End With varRetVal = sintNumFiles Case acLBOpen 'Open varRetVal = Timer 'Generate unique ID for control. Case acLBGetRowCount 'Get number of rows. varRetVal = sintNumFiles Case acLBGetColumnCount 'Get number of columns. varRetVal = 1 Case acLBGetColumnWidth 'Get column width. varRetVal = -1 '-1 forces use of default width. Case acLBGetValue 'Get the data. varRetVal = sastrFiles(lngRow) End Select ListFiles = varRetValEnd Function

geschrieben von




Beitrag anfügen