Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Access2000 / VBA / FileDialog

Empfohlene Antworten

Veröffentlicht

Hi, Leute!

Im Access-Codebook (ADDISON-WESLEY) ist folgende Funktion zu finden, die das Dialogfenster "Datei öffnen" aufruft und Laufwerk, Pfad und Dateinamen inkl. Dateiendung zurückliefert.

Zumindest unter Access 2002.

Wer hat eine Lösung für Access 2000? Dort ist die Eigenschaft/Methode <Application.FileDialog> nicht bekannt.

Die MSO.DLL ist als Verweis eingebunden, allerdings hier die 9.0 (Für Access 2000 ist es die 10.0.). Hat es Sinn die 10er-MSO.DLL unter einem neuen Namen auf Platte zu kopieren und dann über [Durchsuchen...] einzubinden?

'* FF18.1 **************************************************

'Application: Access 2002

'Description: Ordner oder Dateien auswählen

'Parameters: lngDialogType, [lngDialogView], [strTitle], [strInitial], [bolAllowMultiple], [strFilterDesc], [strFilterExt]

'API-Calls:

'References: Office Object Library (MSO.DLL)

'Functions:

'Classes:

'Types:

'Enums:

'Constants:

'Return: String

'* FF18.1 **************************************************

Public Function GetFileOrFolder( _

ByVal lngDialogType As MsoFileDialogType, _

Optional ByVal lngDialogView As MsoFileDialogView, _

Optional ByVal strTitle As String, _

Optional ByVal strInitial As String, _

Optional ByVal bolAllowMultiple As Boolean, _

Optional ByVal strFilterDesc As String, _

Optional ByVal strFilterExt As String) As String

Dim objFD As FileDialog

Dim i As Integer

On Error Resume Next

' Unterstützt werden nur

' msoFileDialogOpen, msoFileDialogFilePicker und

' msoFileDialogFolderPicker

Set objFD = Application.FileDialog(lngDialogType)

Application.d

' Setzen der Dateifilter

objFD.Filters.Clear

If strFilterDesc <> "" And strFilterExt <> "" Then

objFD.Filters.Add strFilterDesc, strFilterExt

End If

' Setzen von Multi-Select

objFD.AllowMultiSelect = bolAllowMultiple

' Setzen der Caption

If strTitle > "" Then

objFD.Title = strTitle

End If

' Setzen des Start-Directories

If strInitial > "" Then

objFD.InitialFileName = strInitial

End If

Call objFD.Show

' Rückgabe einer Semikolon getrennten Liste

' der Dateinamen

If objFD.SelectedItems.Count > 0 Then

For i = 1 To objFD.SelectedItems.Count

GetFileOrFolder = GetFileOrFolder & _

Nz(CStr(objFD.SelectedItems(i)), "") & ";"

Next i

GetFileOrFolder = Left(GetFileOrFolder, _

Len(GetFileOrFolder) - 1)

End If

Set objFD = Nothing

End Function

  • Autor

Hi, Goos!

Vielen Dank: Es war genau das, was fehlte.

Ich habe die API-Funktion zwar nicht in allen Punkten verstanden aber zumindest in denen, die ich brauchte.

Was ich nicht verstehen kann: Warum wurde erst in der sechsten(?) Access-Version etwas einfach zur Verfügung gestellt, das es seit der ersten Version gibt!??

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.