Mit folgenden Agenten könnt Ihr die Excel Tabelle in KSpam importieren!
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim temp1 As String
Dim xlApp As Variant
Dim xlSheet As Variant
Dim cursor As Integer
Dim recordcheck As String
Dim DefaultFileName As String
Dim workspace As New NotesUIWorkspace
On Error Goto ERRORLABEL
Dim FileName As Variant
FileName = workspace.OpenFileDialog(True, "Bitte den Antrag wählen!", "", "C:\")
If FileName(0)="" Then Goto SubEnd
Set xlApp = CreateObject("Excel.Application")
xlApp.Application.Workbooks.Open Filename
xlApp.workbooks.Add
Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
recordcheck="x"
a=1
While recordcheck <>"0" And recordcheck <> "" And a<10000
cursor=0
a=a+1
temp1=xlSheet.Cells(a,1).value '
recordcheck=Cstr(temp1)
If recordcheck="0" Then Goto Finished 'Schleifenende, kein Eintrag mehr in Excel-Datei
Set doc = New NotesDocument(db)
doc.Form = "Rule - Deny"
doc.kAction ="Copy & Deny"
doc.kPriority="2"
doc.kBody=temp1 '
If temp1 <> "" Then
Call doc.Save(True, False)
End If
Finished:
Wend
Goto SubClose
ERRORLABEL:
If Err=213 Then
Resume SubEnd
Else
Messagebox "Error" & Str(Err) & ": " & Error$
End If
Resume Next
SubClose:
xlApp.activeworkbook.close
xlApp.Quit
Set xlapp = Nothing
Call ws.viewrefresh
SubEnd:
End Sub