Hallo zusammen!
Ich stehe, glaube ich mal wieder gewaltig auf dem Schlauch!
Ich bin dabei einen Agenten zu schreiben, der aus eingehenden Emails das Sendedatum (DeliveredDate) und den Betreff (Subject) auslesen soll. Anschließend soll er die Anhänge der Mails auf c:\ speichern und die Dateien nach folgendem Muster umbenennen: DATUM_BETREFF_DATEINAME
Das mit dem Lösen der Anhänge bekomme ich ja noch hin, aber wie ich da jetzt Datum und Betreff reinbekomme ist mir als blutiger Anfänger ein Rätsel.
Danke schon mal für Eure Hilfe:
| Dim session As New NotesSession |
| Dim db As NotesDatabase |
| Dim collection As NotesDocumentCollection |
| Dim doc As NotesDocument |
| Dim Zeit As String |
| Dim Betreff As String |
| |
| Set db = session.CurrentDatabase |
| Set collection = db.UnprocessedDocuments |
| Set doc = collection.GetFirstDocument() |
| While Not(doc Is Nothing) |
| If doc.HasEmbedded Then |
| Set Zeit = doc.GetFirstItem("DeliveredDate") |
| Set rtitem = doc.GetFirstItem("Body") |
| If ( rtitem.Type = RICHTEXT) Then |
| Forall o In rtitem.EmbeddedObjects |
| fileCount = fileCount + 1 |
| If ( o.Type = EMBED_ATTACHMENT ) Then |
| Call o.ExtractFile _ |
| ("c:\reports\"+ Zeit + "_" + Betreff + "_" + o.Source) |
| End If |
| End Forall |
| End If |
| Sleep 1 |
| Set doc = collection.GetNextDocument(doc) |
| End If |
| Wend |
| collection.RemoveAll(True) |
Gruß Markus