konfigurationsdokument

  • hi ich habe folgenden Lotus script code


    Sub Click(Source As Button)

    Dim ws As New NotesUIWorkspace
    Dim s As New NotesSession
    Dim db As NotesDatabase
    Dim oldDoc As NotesDocument
    Dim newDoc As NotesDocument

    Set db = s.GetDatabase("","TestMigrationZiel.nsf")
    Set oldDoc = ws.CurrentDocument.Document
    Set newdoc = New NotesDocument(db)

    Call oldDoc.CopyAllItems(newdoc)
    Call newdoc.Save(True, True) 'neues Dokument speichern

    End Sub


    nun möchte ich die steuerung des pfades über ein konfigurationsdokument lösen ... d.h. ich möchte den namen der zeildatenbank und des zielservers darüber verändern können bspw- von lokal ("") nach svrf03 = servername


    hat jemand eine idee wie ich so etwas lösen könnte ??

  • Profildokument "Profile" erstellen mit z.B. den Feldern "ServerName" und "DatabaseName":


    Sub Click(Source As Button)


    Dim ws As New NotesUIWorkspace
    Dim s As New NotesSession
    Dim db As NotesDatabase
    Dim oldDoc As NotesDocument
    Dim newDoc As NotesDocument


    Dim currdb As NotesDatabase
    Dim profiledoc as NotesDocument


    Set currdb = s.CurrentDatabase
    Set profiledoc = currdb.GetProfileDocument("Profile")
    ServerName$ = profiledoc.ServerName(0)
    DatabaseName$ = profiledoc.DatabaseName(0)


    Set db = s.GetDatabase(ServerName$, DatabaseName$)
    Set oldDoc = ws.CurrentDocument.Document
    Set newdoc = New NotesDocument(db)


    Call oldDoc.CopyAllItems(newdoc)
    Call newdoc.Save(True, True) 'neues Dokument speichern


    End Sub

  • Einfacher geht das Kopieren von Dokumenten in eine andere Datenbank mit der Methode "CopyToDatabase" in der Klasse "NotesDocument". Damit bleibt auch das ursprüngliche Erstellungsdatum (Abfrage über @Created) erhalten!
    Schau es Dir einfach mal in der Designer-Hilfe an...


    Gruß
    Christoph