Also hier das Script:
'# Allgemeine Variablendeklirationen
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
'# Pruefziffernkontrolle Variablendeklirationen
Dim kontonr As String
Dim laenge As Integer
Dim zahl As Integer
Dim i As Integer
Dim summe As Integer
Dim modulo_erg As Integer
Dim pruefziffer As Integer
Dim letzte As Integer
Set uidoc=ws.currentdocument
'# Beginn Pruefziffernkontrolle
Set ws = New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
kontonr = Cstr( doc.tKontonummer(0) )
If Len(kontonr) > 7 Then
kontonr = Right$(kontonr, 7)
End If
laenge = Len( kontonr )
summe = 0
For i = 2 To laenge
zahl = Cint( Mid( kontonr, laenge - i + 1, 1 ) )
summe = summe + zahl * i
Next
modulo_erg = summe Mod 11
If modulo_erg <= 1 Then
pruefziffer = 0
Else
pruefziffer = 11 - modulo_erg
End If
letzte = Cint( Mid( kontonr, laenge ,1 ))
If letzte = pruefziffer Then
Messagebox "Prüfziffernkontrolle erfolgreich abgeschlossen"
Else
Messagebox "Prüfziffernkontrolle nicht bestanden"
End If
'# Ende Pruefziffernkontrolle