« OpenNTF Everywhere | Main| DON'T MISS THE DEADLINE!!! »

ConvertToMIME Method

If you're like me, you've been wondering for about a decade when Lotus would finally deliver this method.  Looks like with 8.5.1, the wait is at last over.  Taken from the Lotus Domino Designer Help, I give you.... NotesDocument.ConvertToMIME

Converts a document in Notes format to MIME format similar to a mail router.
Note  This method is new in Release 8.5.1.

Defined in
NotesDocument

Syntax
Call notesDocument.ConvertToMIME( conversionType, options )

Parameters
conversionType
Integer. Optional. One of the following:

CONVERT_RT_TO_HTML (2) produces MIME output with a Text/HTML part that is a representation of the Notes rich text. Some data loss is possible in the rendering. Improvements in fidelity may occur at any time.

CONVERT_RT_TO_PLAINTEXT (1) produces MIME output with a Text/Plain part that is a representation of the Notes rich text. Everything but text contained in rich text is lost. For tables, a crude approximation is made using non-graphic characters.

CONVERT_RT_TO_PLAINTEXT_AND_HTML (3) (default) produces MIME output with two renditions of the Notes rich text: a Text/Plain part and a Text/HTML part. The characteristics of each stream are the same as their corresponding descriptions above. This is useful when the target audience may or may not have an HTML-capable mail reader, or can receive only text.
options

Long. Optional. Reserved for future use.

Usage
The document's form is evaluated and the fields are used in the MIME conversion.
The conversion of rich text is imperfect.


The last sentence must surely send Ben Langhinrichs into hysterics.

Comments

1 - And it converts the entire document. There is no easy way to just convert a single richtext field into mime. How does it handle embedded images ?

2 - It converts the entire document because it uses the form. If you wanted just one RT item, then put it on a form all by itself and then switch forms, I guess. I have no idea how it handles embedded images. I haven't tried it. Just saw it in the documentation. Emoticon

3 - Wow... this just makes me shudder. I'd bet that the rendering done by this is (for no apparent reason) just slightly different than than the rendering performed by either the router or the Notes client. And it exhibits slightly different behavior when running on a server vs. client. Cool they added it though, I guess.

4 - dude. thanks for posting this. i am quivering with delight. quivering, i say!

5 - Doesn't display embedded images, attached files are shown as "see attached file - name".

Nathan beat me to a "rich text in views" blog post where this is partly featured.

6 - Oh, shucky-darn. IBM comes through in 8.5.1 with a method inferior to one I delivered for R5. What ever shall I do?

I wonder if it occurred to IBM, which used to be quite proud of its extension points, to make an event or entry point so that you could plug in a superior rendering engine when using this. Probably not, because it can hardly have occurred to them than ANYBODY could make a better rendering engine than they have.

7 - Thanks, IBM. But I must admit, I'm with Ben in this one.

I mean, why didn't they contact Ben Langhinrichs, who - as we all know - has developed the best and best proven solution to handle MIME and RT items?

8 - "Usage
The document's form is evaluated and the fields are used in the MIME conversion.
The conversion of rich text is imperfect"

I don't know if I could keep my job saying to my boss "The export of the yearly sales report is imperfect"

But, then again. I'm not IBM.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Search 

Disclaimer 

Welcome to Escape Velocity!

Opinions expressed here by Nathan T. Freeman are not necessarily those of his employer. However, there's a decent chance they are, so check with them if you really want to know.

But really... do you need that kind of validation? Are the opinions expressed here in doubt?

MiscLinks