In an agent, I want to copy “Body” item of a mail of my mailbox in another document of another database.
Agent is in a database, I get my mailbox and I get all documents I want and copy “Body” item in a new document.
But I loose completly formatting text and picture of mail.
I saw “Body” item in mail is mime_part type and although I select “store contents as HTML and MIME” in my item in the form of my new document, it doesn’t store as.
I try copyItemToDocument() and appendRTItem() but it doesn’t work.
Any idea pleased ?
An extract of my agent :
While Not ( DocMail Is Nothing)
Set item = DocMail.GetFirstItem( “Body” )
Set docrevue = New NotesDocument(db)
docrevue.form = “Revue”
Set varpdf = DocMail.GetFirstItem(“Body”)
Set item = varpdf.copyItemToDocument(docrevue, “PRE_revue”)
Call docrevue.Save(True, False)
'I also tried this
'Set Pre_revue = New NotesRichTextItem(docrevue,“PRE_revue”)
The NotesMIMEEntity class is used to access items of type MIME (Multipurpose Internet Mail Extensions). MIME defines techniques for handling 8-bit data, character sets, and a variety of content types. MIME also allows for structured messages, where a message can have multiple parts and relations between the parts.
A typical example is an Internet mail message routed to a mail file without conversion to rich text.
The MIME parts of a document are items of type MIME_PART. In Internet mail messages they are typically named “Body.” Programmatically you can access these items as NotesItem, NotesRichTextItem, or NotesMIMEEntity objects.
To access the MIME content of a NotesDocument:
First set NotesSession.ConvertMIME to False to override normal conversion of MIME items to rich text.
Then call NotesDocument.GetMIMEEntity.
Or call NotesDocument.GetFirstItem followed by NotesItem.GetMIMEEntity.
To create an item in MIME format, call NotesDocument.CreateMIMEEntity.
To close MIME processing so you can work on items directly, call NotesDocument.CloseMIMEEntities.
Before exiting your code, set NotesSession.ConvertMIME back to True (or the original setting).