Export Email - headers and body

Hello, I need to provide a button for certain people on their mail template to export the currently opened email to someplace else…

@Command([FileExport] does not export header data (from, to, subject, date, etc.).

Does anyone know the best way to handle this?

Subject: Export Email - headers and body

Thanks for all of the responses. I think the path I’m going to try to take is this:Create an Action button on the Memo form that creates a new form on the back end with all of the memo info on it, then executes an agent that exports that form information (which i haven’t implemented yet).

So far it works, except I can’t get the “From” info from the memo!!! It always appears as the same as the “SEND TO” field.

(oh… did i mention i am not very good at LS??? Just this simple code below took me a hour!!!).

Sub Click(Source As Button)

Dim Session As New NotesSession

Dim Workspace As New NotesUIWorkspace

Dim db As notesDatabase

Set UIDoc = Workspace.CurrentDocument

Set TheDocument = UIDoc.Document

Set db = New NotesDatabase("", "")

’ Open user’s mail database

db.openmail

’ Get vars from document

DisplayDate = Uidoc.FieldGetText("DisplayDate")

SendTo = Uidoc.FieldGetText("SendTo")

From2 = Uidoc.FieldGetText(“From”)

Subject =  Uidoc.FieldGetText("Subject")

Body =  Uidoc.FieldGetText("Body")





Dim MemoInfo As New NotesDocument(db)

MemoInfo.Form = "MemoInfo"

'Place string in MemoInfo fields

MemoInfo.xxFrom = Cstr(From2)

MemoInfo.xxDate = Cdat(DisplayDate)

MemoInfo.xxTo = Cstr(SendTo)

MemoInfo.xxSubject = Cstr(Subject)

MemoInfo.xxBody = Cstr(Body)



Call MemoInfo.ComputeWithForm(True,False)

Call MemoInfo.save(False, False)

End Sub

Subject: Export Email - headers and body

Hi Diane,

Were you able to get this up running - are you able to export your mails(and attachments)??

Kjeld

Subject: Export Email - headers and body

Did you see this:http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/c17743e08af4c6b285256f4f00667996?OpenDocument

or any of these hits:

http://www-10.lotus.com/ldd/46dom.nsf/Search?SearchView&Query=export%20email&SearchOrder=0&Start=1&Count=100

HTH.

Gregg

Subject: Export Email - headers and body

I’ve never been able to figure out why that happens - I know the header is a subform but you can do one or the other (depending on focus when you hit export) but not both.

I know its a work-around - but to simplify everything I modified the Memo form in the mail file to include a couple of computed fields such as from and sentdate

I placed these below the body field (or outside the header - and then just export using the internal command.

It’s a problem if you can’t modify your template form and whenever you do a version upgrade it will overwrite the templates and you have to go back and modify again,

Subject: Export Email - headers and body

If a third party product is an option, our Midas Rich Text LSX will let you export to MIME, including the headers, as either a .eml file readable by Outlook or a .mht file readable by Internet Explorer (technically a Web Archive format). Otherwise, your best bet is probably using the NotesMIMEEntity class and retrieving each part.