hi zusammen. wolte mal wieder von nem neuen bug berichten.
SMTP-Mails die nachträglich mit dem Notes-Client gespeichert werden, 'verlieren' die Anhänge beim RenderToRichtextItem (bestätigt von IBM ab 8.5.1 inkl. dem aktuellen 'daily build' von 8.5.3 ...
wer das gleiche problem hat, kann sich gerne auf den SPR # RGAU8JALFS bzw. den APAR # LO61978 beziehen.
Folgender 'Workaround' wird von IBM angeboten (muss sicherlich noch verfeinert werden ...):
Code
Option Public
Option Declare
Sub Initialize
Const tmpPath = "c:\temp"
Dim uiws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim note As NotesDocument
Dim tmp_note As NotesDocument
Dim tmp_body As NotesRichTextItem
Dim eo As NotesEmbeddedObject
Dim newFileName As String
Set db = s.CurrentDatabase
Set col = db.Unprocesseddocuments
If ( col.Count <> 1 ) Then
Exit Sub
End If
Set note = col.GetFirstDocument
Set tmp_note = db.Createdocument()
Call tmp_note.ReplaceItemValue("Form", "Body")
Set tmp_body = tmp_note.Createrichtextitem("Body")
' search all items for attachments
ForAll i In note.items
If (i.type = Attachment) Then
' detach with new name
Set eo = note.GetAttachment(i.values(0))
newFileName = tmpPath & "new_" & eo.Source
Call eo.ExtractFile(newFileName)
' remove old
eo.Remove
' attach new
Call tmp_body.EmbedObject( EMBED_ATTACHMENT, "", newFileName)
End If
End ForAll
Call note.Rendertortitem(tmp_body)
Call uiws.Editdocument(True, tmp_note)
End Sub
Alles anzeigen