Domino 9 und frühere Versionen > ND6: Entwicklung
Fehler im Script
(1/1)
RvM:
???
Ich möchte gerne von einem vorhandenem Dokument eine Kopie erstellen. dazu habe ich folgendes Script einem Button zugewiesen:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim v As NotesUIDatabase
Dim oldDoc As NotesDocument
Dim newDoc As NotesDocument
Dim thisDoc As NotesUIDocument
Set ws = New NotesUIWorkspace
Set v = ws.CurrentDatabase
Set db = s.CurrentDatabase
Set thisDoc = ws.CurrentDocument
Set oldDoc = ws.CurrentDocument.Document
Set newDoc = OldDoc.CopyToDatabase(db)
Bei der letzten Zeile wird mit der Fehlermeldung: "Invalid universal ID" abgebrochen. Was mich nun irritiert ist, das dieses Script in einer anderen Anwendung, die eine Kopie dieser Anwendung ist, einwandfrei funktioniert.
Was ist da falsch dran?
Glombi:
Ist das aktuelle Dokument bereits gespeichert?
Falls nicht, würde ich dann noch folgendes machen:
Set db = s.CurrentDatabase
Set thisDoc = ws.CurrentDocument
if thisDoc.IsNewDoc then
call thisDoc.Save
end if
Set oldDoc = ws.CurrentDocument.Document
Set newDoc = OldDoc.CopyToDatabase(db)
RvM:
;)
Jepp - das war's
DANKE!
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln