Domino 9 und frühere Versionen > Entwicklung

Probleme beim kopieren

(1/2) > >>

Thunder:
Wie bekomme ich es hin, ein derzeit geöffnetes Dokument, welches noch bearbeitet wurde und noch nicht gespeichert ist in eine andere DB zu kopieren ?
Mit folgendem Script kopiert er die neuen Änderungen nicht mit.
Setze ich einen 'Call olddoc.save (true,true)' dazwischen - wird gar nichts kopiert.
:(



Sub Initialize
   Dim ws As New notesuiworkspace
   Dim s As New notessession
   Dim db As notesdatabase
   Dim olddoc As notesdocument
   Dim newdic As notesdocument   
   
   
   Set db = s.getdatabase ("S155LN03","Kredit\Aktenanforderung (Archiv).nsf")
   Set olddoc = ws.currentDocument.Document   
   Set newdoc = olddoc.copytodatabase(db)
End Sub

Glombi:
So:

Sub Initialize
   Dim ws As New notesuiworkspace
dim uidoc as NotesUIDocument
   Dim s As New notessession
   Dim db As notesdatabase
   Dim olddoc As notesdocument
   Dim newdic As notesdocument  
   
   set uidoc = ws.CurrentDocument
call uidoc.Save
   Set db = s.getdatabase ("S155LN03","Kredit\Aktenanforderung (Archiv).nsf")
   Set olddoc = uidoc.Document  
   Set newdoc = olddoc.copytodatabase(db)
End Sub

Thunder:
Besten Dank !

Thunder:
Aber warum klappt das nicht ? - Hier wird wieder nix kopiert.

Sub Click(Source As Button)
   Dim ws As New notesuiworkspace
   Dim uidoc As NotesUIDocument
   Dim s As New notessession
   Dim db As notesdatabase
   Dim olddoc As notesdocument
   Dim newdic As notesdocument  
   
   Set uidoc = ws.CurrentDocument
   Call uidoc.fieldsettext ("Status", "Aktenlager")
   Call uidoc.fieldsettext ("Aktenort", "Aktenlager")
   
   Call uidoc.Save
   
   Set db = s.getdatabase ("S155LN03","Kredit\Aktenanforderung (Archiv).nsf")
   Set olddoc = uidoc.Document  
   Set newdoc = olddoc.copytodatabase(db)
   
   Call uidoc.close
End Sub

Glombi:
Ich habe nicht viel Zeit - der Grill wartet  ;D

Sub Click(Source As Button)
   Dim ws As New notesuiworkspace
   Dim uidoc As NotesUIDocument
   Dim s As New notessession
   Dim db As notesdatabase
   Dim olddoc As notesdocument
   Dim newdic As notesdocument  
   
   Set uidoc = ws.CurrentDocument
   Set olddoc = uidoc.Document  

   olddoc.Status = "Aktenlager"
   olddoc.Aktenort = "Aktenlager"
   
call uidoc.Reload
   Call uidoc.Save
   
   Set db = s.getdatabase ("S155LN03","Kredit\Aktenanforderung (Archiv).nsf")
   Set newdoc = olddoc.copytodatabase(db)
   
   Call uidoc.close
End Sub

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln