Access: Dateisystem
Das Beispiel:
Zugriff auf Ordner mit Vorlagen
In Modul (erlaubt zentralen Zugriff):
Public tmplateList 'enthält die Namen der Dateien
Bei Startform (einmalig, da hier der aufwendige Zugriff):
Dim filesys
Dim tmplatePath
Set filesys = CreateObject("Scripting.FileSystemObject")
Set tmplatePath = filesys.GetFolder(_
Application.CurrentProject.Path & templatePath & "\")
Set tmplateList = tmplatePath.files 'enthält die Liste
Eintragen in Combobox (im Combo-Form):
Dim f 'Vollständiger Name mit Pfad
Dim n 'nur der Dateiname ohnePfad und Endung
For Each f In tmplateList
If Right(f, 4) = ".dot" Then
n = Left(f, Len(f) - 4)
n = Right(n, Len(n) - InStrRev(n, "\"))
kmbDateilist.AddItem (f & ";" & n)
End If
Next
Labels: Access, Combo, Datei, Dateisystem, Filesystem, Kombinationsfeld, Ordner

