Domino 9 und frühere Versionen > Entwicklung
Mail Attachment in eine Neues Dokument kopieren
koehlerbv:
"neon" braucht aber lange, den richtigen Code herauszusuchen ...
@Uwe AKA datenbanken24:
Prinzipbedingt wirst Du wohl nicht in de Lage sein, einzelne Attachments ohne den Umweg via Platte zu transferieren. Wobei auch hier das "offene Messer" bleibt, das es Probleme gibt, wenn zwei Attachments mit gleichem Filenamen (was ja ohne weiteres möglich ist) in einem Dokument existieren ... Da ist jetzt wirklich das "Quality"-Team gefragt - und dem sollte Druck gemacht werden.
@neon: Mich interessiert jetzt wirklich, wie das nun weitergeht. Hier haben ja nun einige Zeit investiert ...
Bernhard
@Uwe: Liest Du PMs ?
D. Roth.:
So was lange wärt wird endlich gut. Sorry hatte ;D Urlaub ;D!
Die Post von eknori hört sich gut werd ich gleich probieren!!
der aktuelle Souce Code :
Dim Cgetmail As GetMail
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As Notesuidocument
Set db = s.CurrentDatabase
Dim BodyItem As NotesItem
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Set Cgetmail = New GetMAil
Call Cgetmail.getBodyItem
Call Cgetmail.getSubjectItem
' Set ItemBody = doc.CopyItem( Cgetmail.BodyItem ,"FrmDocContent" )
Call Cgetmail.BodyItem.CopyItemToDocument( doc, "FrmDocContent" )
D. Roth.:
So hab den Source Code von eknori ausprobiert aber leider funktioniert er nicht wenn, man Attachments aus Mails kopieren will. Nämlich sobald, man das Body Feld löscht verschwinden auch die $File Felder.
Der Source Code ist noch im Teststadium ;-)
Dim Cgetmail As GetMail
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As Notesuidocument
Set db = s.CurrentDatabase
Dim BodyItem As NotesItem
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Set Cgetmail = New GetMAil
Call Cgetmail.getBodyItem
Call Cgetmail.getSubjectItem
Dim DocTemp As NotesDocument
Set ItemBody = doc.CopyItem( Cgetmail.SubjectItem, "FrmDocTitel" )
'Create a temporary document and use CopyAllItems from the current document
'because I know that will include the attachment
Set docTemp = db.CreateDocument
Call Cgetmail.Maildoc.CopyAllItems (docTemp)
Stop
'Clear all items not named $File from the temp docSource, so that allthat's left is the attachment
Forall item In docTemp.Items
If Not (Ucase(item.Name) = "$FILE") Then
If Not (item.Name = "Body" ) Then
docTemp.RemoveItem (item.Name)
End If
End If
End Forall
'Now, docTemp only has the attachments left on it
'CopyAllItems will copy the attachment, so use it to copy to docTarget
Call docTemp.CopyAllItems (doc)
doc.RemoveItem ("Body")
Call doc.save(True,True)
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln