Copy "Body" item in another document

Hello,

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”)

'Call Pre_revue.AppendRTItem(varpdf)

'Call docrevue.Save(True, False)

'…

wend

Subject: From Designer help

Working with a MIME entity in LotusScript classes

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).

Does this help?

Subject: copy “Body” item in another document

Hello,

all you’ll try with standard methods do not work here.

3rd. party products can help (like midas), but will cost.

Most easy way. Copy the whole document (.copyToDatabase),

and replace the fields of your targetdocument within the copy.

DO NOT MODIFY the richtext and be aware, your document copy

will include Items like “$Fonts”, which are necessary for correct

formatting.

bye

Christian

Subject: RE: copy “Body” item in another document

It works and actually, it’s the most simple.

Thanks a lot