Hallo Leute,
ich muss den Posteingang von Notes nach bestimmten Betreffs durchsuchen und dann evtl. Mails löschen. Hab nach langem Suchen im Netz gefunden wie man per VB Mails über Notes versendet. Anscheinend bin ich jedoch zu doof aus dem Code herauszulesen wie das Durchlesen des Eingangs funktioniert. Kann mir jemand helfen (Code zum Senden von Mails im Anhang !).
Vielen Dank
Tom
Dim domSession As New NotesSession
Dim domNotesDatabaseMailFile As NotesDatabase
Dim domNotesDocumentMemo As NotesDocument
Dim domNotesRichTextItemBody As NotesRichTextItem
’ Put your passwork in the quotes below to skip propting
domSession.Initialize („test“)
'On Error GoTo ErrorHandler
’ Either SendTo, CopyTo, or BlindCopyTo is required.
Dim dbdir As NotesDbDirectory
Set dbdir = domSession.GetDbDirectory("")
Set domNotesDatabaseMailFile = dbdir.OpenMailDatabase()
’ Generate an error if previous attempts were unsuccessful.
If domNotesDatabaseMailFile Is Nothing Then
MsgBox („Mail file not open“)
Exit Sub
End If
Dim SendToArray As Variant
SendTo = „[email protected]“
’ Create a new memo document.
Set domNotesDocumentMemo = domNotesDatabaseMailFile.CreateDocument
Call domNotesDocumentMemo.AppendItemValue(„Form“, „Memo“)
Call domNotesDocumentMemo.AppendItemValue(„From“, domSession.CommonUserName)
Call domNotesDocumentMemo.AppendItemValue(„SendTo“, SendTo)
Call domNotesDocumentMemo.AppendItemValue(„Subject“, „Derzeitiger Stand zum Testsystem“)
Set domNotesRichTextItemBody = domNotesDocumentMemo.CreateRichTextItem(„Body“)
domNotesRichTextItemBody.AppendText (TextString)
’ This is where you can add support for attachments.
'attachment1 = „c:\test.SPS“
'Call domNotesRichTextItemBody.EmbedObject(EMBED_ATTACHMENT, „“, attachment1) 'attaches the file to the body field
’ Send the document.
domNotesDocumentMemo.Send (False)
'MsgBox "Mail Sent with Attachment " & attachment1
Set domSession = Nothing
Exit Sub
ErrorHandler:
MsgBox Err.Number & " " & Err.Description