Hallo zusammen,
ich muss gestehen, mit der Formelsprache gehts inzwischen ganz gut...
Aber ich möchte auch versuchen, in LotusScript reinzukommen...
Ist zwar eigentlich nicht mein Job, aber ich finde es hochspannend.
Ich versuche so eine Art Delte Sicherung aufzubauen...
Aber ich bekomme immer wieder die Meldung "Object variable not set"
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim ui As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set db=Session.CurrentDatabase
Set uidoc=ui.CurrentDocument
If uidoc.FieldGetText("n_sw_del_safe") = 1 Then
Messagebox "Document is delteable"
Else
Messagebox "Document is not delteable"
End If
Also man geht quasi hin und selektiert ein Document in einer View und drückt auf Entf.
Zum Test soll dann erst mal diese Messagebox erscheinen...
Ich bin in LS wirklich Anfänger...
Grüße,
Jimmy
Documents ist ein Property der Klasse NotesUIDatabase
Auszug aus der Hilfe:
Documents property
Read-only. All the documents that the current NotesUIDatabase event is working on.
Defined in
NotesUIDatabase
Data type
NotesDocumentCollection
Syntax
To get: Set notesDocumentCollection = notesUIDatabase.Documents
Usage
If the collection is empty, Documents.Count is 0.
Und es gibt auch Beispiele dazu (darunter auch eins für das Event QueryDocumentDelete):
Examples: NotesUIDatabase class
This example tracks the number of document deletions that occur while a database is open.
(Declarations)
Dim deleteCount As IntegerSub Postopen(Source As Notesuidatabase)
deleteCount = 0
End Sub
Sub Querydocumentdelete(Source As Notesuidatabase, _
Continue As Variant)
If Continue Then
deleteCount = deleteCount + Source.Documents.Count
End If
End Sub
Sub Querydocumentundelete(Source As Notesuidatabase, _
Continue As Variant)
If Continue Then
deleteCount = deleteCount - Source.Documents.Count
End If
End Sub
Sub Postdocumentdelete(Source As Notesuidatabase)
Messagebox Source.Documents.Count _
& " deleted or marked for deletion"
End Sub
Sub Queryclose(Source As Notesuidatabase, Continue As Variant)
Messagebox deleteCount & " documents deleted",, _
"Net deletions"
End Sub
Axel