Danke dir, habe das auch schon gefunden, komme damit (siehe Script aus der Hilfe nachstehend) aber nicht weiter. Brauche den mime-type des Attachments.
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim m As String
Set db = s.CurrentDatabase
s.ConvertMIME = False ' Do not convert MIME to rich text
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
While Not(doc Is Nothing)
Set mime = doc.GetMIMEEntity
If Not(mime Is Nothing) Then
Messagebox mime.ContentAsText,, _
doc.GetItemValue("Sunject")(0)
Else
Messagebox "Not MIME",, _
doc.GetItemValue("Subject")(0)
End If
Set doc = dc.GetNextDocument(doc)
Wend
s.ConvertMIME = True ' Restore conversion
End Sub
weiss nicht obs hilft:
Das in Initialize eines Agenten in der Mail-db.
-> Auswahl im Menü Aktionen
-> Ziel: Alle ausgewählten Dokumente
Dokumente anhaken und dann Agenten per Menü starten.
Vielleicht kannst du das irgendwie nutzen.
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim child As NotesMIMEEntity
Dim m As String
Set db = s.CurrentDatabase
s.ConvertMIME = False
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Dim countChild As Integer
While Not(doc Is Nothing)
Msgbox "startMail mail->" & doc.subject(0)
Set mime = doc.GetMIMEEntity
If Not(mime Is Nothing) Then
If mime.ContentType = "multipart" Then
If mime.Preamble = "" Then
p$ = "No preamble"
Else
p$ = mime.Preamble
End If
Messagebox p$,, "preamble of:" & doc.GetItemValue("Subject")(0)
Set child = mime.GetFirstChildEntity
countChild = 0
While Not(child Is Nothing)
countChild = countChild + 1
m = "Content type:" & Chr(9) & _
child.ContentType & Chr(13) & _
"Content subtype:" & Chr(9) & _
child.ContentSubType & Chr(13) & _
"Character set:" & Chr(9) & _
child.Charset & Chr(13) & _
"Encoding:" & Chr(9) & Chr(9) & _
child.Encoding
Messagebox m,, "child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0)
Messagebox child.Headers,, "Headers von child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0)
Messagebox child.ContentAsText,, "child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0)
Set child = child.GetNextSibling
Wend
Else ' if not multipart
m = "Content type:" & Chr(9) & _
mime.ContentType & Chr(13) & _
"Content subtype:" & Chr(9) & _
mime.ContentSubType & Chr(13) & _
"Character set:" & Chr(9) & _
mime.Charset & Chr(13) & _
"Encoding:" & Chr(9) & Chr(9) & _
mime.Encoding
Messagebox m,, "main of mail:" & doc.GetItemValue("Subject")(0)
Messagebox mime.Headers,, "Headers of main of mail:" & doc.GetItemValue("Subject")(0)
Messagebox mime.ContentAsText,, _
"main of mail:" & doc.GetItemValue("Subject")(0)
End If
Else ' if not MIME
Messagebox "Not MIME",, _
doc.GetItemValue("Subject")(0)
End If
Msgbox "END mail->" & doc.subject(0)
Set doc = dc.GetNextDocument(doc)
Wend
s.ConvertMIME = True ' Restore conversion
End Sub
Hi,
ich habe eine Möglichkeit gefunden, um die "MIME-Files" auf Platte zu speichern:
Dim session As New NotesSession
Dim mime As NotesMIMEEntity
Dim child As NotesMIMEEntity
Dim stream As NotesStream
Dim pathname As String
Dim countChild As Integer
session.ConvertMIME = False
Msgbox "startMail mail->" & docMail.subject(0)
Set mime = docMail.GetMIMEEntity
If Not(mime Is Nothing) Then
Set child = mime.GetFirstChildEntity
countChild = 0
While Not(child Is Nothing)
countChild = countChild + 1
'GIF speichern
If child.ContentType = "image" And child.ContentSubtype = "gif" Then
Set stream = session.CreateStream
pathname = "D:\temp\mime\mimeimage" & countChild &".gif"
If Not stream.Open(pathname, "binary") Then
Messagebox pathname,, "Open failed"
'Goto ExitSub
End If
Call child.GetContentAsBytes(stream)
Call stream.Close()
Else
Messagebox "Not GIF",, docMail.GetItemValue("Subject")(0)
End If
' JPEG speichern
If child.ContentType = "image" And child.ContentSubtype = "jpeg" Then
Set stream = session.CreateStream
pathname = "D:\temp\mime\mimeimage" & countChild &".jpeg"
If Not stream.Open(pathname, "binary") Then
Messagebox pathname,, "Open failed"
'Goto ExitSub
End If
Call child.GetContentAsBytes(stream)
Call stream.Close()
Else
Messagebox "Not JPEG",, docMail.GetItemValue("Subject")(0)
End If
Set child = child.GetNextSibling
Wend
Else ' if not MIME
Messagebox "Not MIME",, _
docMail.GetItemValue("Subject")(0)
End If
Msgbox "END mail->" & docMail.subject(0)
session.ConvertMIME = True ' Restore conversion
So klappt das schonmal mit gif´s und jpeg´s bei mir... werde diesen Code noch etwas ausbauen und dann so nutzen.
Wenn jemand zufällig ein grober Schnitzer/Anregungen o.ä. hierzu auffallen sollten, dann immer raus damit.
Gruß
Rico.