title image


Smiley Re: Welche Dateitypen liegen in einem Verzeichnis?
Such dir eins aus:



Public Function AlleDateiTypenImVerzeichnis(ByVal strFolder As String) As Collection

Dim FSO As New Scripting.FileSystemObject, FSOFold As Scripting.Folder, _

FSOFile As Scripting.File, C As New Collection, Tmp As String



Set FSOFold = FSO.GetFolder(strFolder)

For Each FSOFile In FSOFold.Files

Tmp = FSOFile.Name

Tmp = Mid(Tmp, InStrRev(Tmp, "."))

'

' oder auch:

' Tmp = FSOFile.Type

'

On Error Resume Next

C.Add Tmp, Tmp

On Error GoTo 0

Next FSOFile

Set AlleDateiTypenImVerzeichnis = C

End Function



Public Function AlleDateiTypenImVerzeichnis1(ByVal strFolder As String) As Collection

Dim strFName As String, C As New Collection, Tmp As String



strFName = Dir(strFolder & "*.*")

Do Until strFName = ""

Tmp = Mid(strFName, InStrRev(strFName, "."))

On Error Resume Next

C.Add Tmp, Tmp

On Error GoTo 0

strFName = Dir()

Loop

Set AlleDateiTypenImVerzeichnis1 = C

End Function



Gruß aus dem Norden
Reinhard


Bitte immer die Access-Version angeben!
DB-Wiki


Wie man Fragen richtig stellt

YaccessAccess-FAQUnd ansonsten: Wikipedia




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: