Hallo
aus dem bisherigen hab ich mir folgendes zusammengebastelt:
es funzt sowiet fast, aber bei Call rtitem.AppendRTItem(doc.Body) kommt ein Mismatch und ich kann mir nicht vorstellen warum?
Dim NotesColl As NotesDocumentCollection
Dim session As New NotesSession
Dim mailbox As New NotesDatabase("","")
Dim current As NotesDatabase
Dim maildoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim dummy As Variant
Dim i As Integer
Dim doc As NotesDocument
Dim sendto As String
Dim sendas As String
Dim subject As String
Set NotesColl=session.CurrentDatabase.UnprocessedDocuments
If NotesColl.count>0 Then
Set doc=notescoll.GetFirstDocument
For i = 1 To NotesColl.count
sendas="CN=Agent/O=lwb"
sendto=doc.subject(0)
subject=doc.From(0)
' get handle to mail.box on the users current mail server
Set current = session.CurrentDatabase
Call mailbox.Open( current.server, "mail.box" )
' Create a new document in the severs mail box
Set maildoc = mailbox.CreateDocument
maildoc.Form = "Memo"
maildoc.From = sendas
maildoc.SendFrom = sendas
maildoc.SendTo = sendto
maildoc.Recipients = sendto
maildoc.Subject = subject
Set rtitem = maildoc.CreateRichTextItem("Body")
Call rtitem.AppendRTItem(doc.Body)
maildoc.PostedDate = Now()
maildoc.ComposedDate = Now()
maildoc.DeliveredDate = Now()
maildoc.Principal = sendas
maildoc.EncryptOnSend = False
Call maildoc.Save( True, False )
Set doc=notescoll.GetNextDocument(doc)
Next i
End If