Hallo Andreas,
ich habe es dir extrahiert - sollte laufen - habe es nicht groß getestet:
Grüßle
Toni
' #
Option Explicit
'
Function GetFilePath( bMultiple As Variant , sFilters As String , sPath As String , sDefault As String ) As Variant
' # Öffnet die Dialogmaske zur Auswahl einer Datei
' # bMultiple => True = Mehrfachauswahl möglich, False = nur eine Datei kann gewählt werden
' # sFilters => Einschränkung der anzuzeigenden Dateien = "MS EXCEL|*.xls"
' # sPath => Startordner der Anfrage
' # sDefault => Vorgabename einer Datei
' # Rückgabe ist immer ein Array mit mindestens einer Variablen.
Dim ws As New NotesUIWorkspace
Dim sPrompt As String
Dim vFile As Variant
Dim sDummy( 0 to 0 ) As String
'
If bMultiple Then
sPrompt = "Wählen Sie mindestens eine Datei"
Else
sPrompt = "Wählen Sie eine Datei"
End If
'
vFile = ws.OpenFileDialog( bMultiple , sPrompt , sFilters , sPath , sDefault )
If IsArray( vFile ) Then
If vFile(0) <> "" Then
getFilePath = vFile
Else
getFilePath = sDummy
End If
Else
getFilePath = sDummy
End If
End Function
Sub Initialize( )
On Error GoTo ErrorHandle
' # lokale Deklarationen...
Dim session As New NotesSession
Dim dbLocal As NotesDatabase
'
Dim vFile As Variant ' # DB die NICHT im Data-Verzeichnis liegt und repliziert werden soll
'
vFile = GetFilePath( False , "C:\Temp\" , "Notes Database|*.nsf" , "" )
If vFile(0) = "" Then
Print "Abbruch - Es wurde keine Datei ausgewählt"
Exit Sub
End If
'
If Lcase( Right( vFile(0) , 4 ) ) != ".nsf" Then
Print "Abbruch - Es wurde keine Notes-Datenbank ausgewählt"
Exit Sub
End If
Set dbLocal = session.GetDatabase( "" , vFile(0) )
If dbLocal Is Nothing Then
Print "Abbruch - die Datenbank kann nicht initialisiert werden"
Exit Sub
End If
'
If dbLocal.Replicate( "" ) Then
Print "... Replikation abgeschlossen"
Else
Print "FEHLER: Die Replikation konnte nicht durchgeführt werden!"
End If
'
WayOut:
Exit Sub
ErrorHandle:
MsgBox |FEHLER | & erl & | => | & Error , 16 , |Fehler in Zeile | & Erl
End Sub