IsConvertMIME (NotesSession - JavaScript™)
Read-Write. Indicates whether items of type NotesItem.MIME_PART
are
converted to rich text upon NotesDocument instantiation.
Defined in
NotesSessionSyntax
isConvertMIME() : boolean
setConvertMIME(flag:boolean) : void
Legal value | Description |
---|---|
true |
to convert MIME items to rich text |
false |
to not convert MIME items to rich text |
Usage
This setting is initially true but persists across Notes® client events. In general, if you change this setting, you should restore it before exiting.Changes to this property apply only to those items opened by the backend processor after the property has been changed. If a document has already been opened as an Item, changing this property will have no effect on the Item.
Examples
This button dumps information and content from a document in MIME format. The document must not be converted to rich text.session.setConvertMime(false); // Do not convert MIME to rich text
var dc:NotesDocumentCollection = database.FTSearch(requestScope.token);
if (dc.getCount() > 0) {
// Get first document that matches user search token
var doc:NotesDocument = dc.getFirstDocument();
requestScope.status = doc.getItemValueString("subject");
var me:NotesMIMEEntity = doc.getMIMEEntity();
if (me != null) {
// Dump MIME information
requestScope.status += "\nContent type:\t" + me.getContentType();
requestScope.status += "\nContent subtype:\t" + me.getContentSubType();
requestScope.status += "\nCharacter set:\t" + me.getCharset();
requestScope.status += "\nEncoding:\t\t" + me.getEncoding();
requestScope.status += "\n*Headers*";
requestScope.status += "\n" + me.getHeaders();
// Dump MIME content
if (me.getContentType().equals("multipart")) {
if (!me.getPreamble().equals("")) {
requestScope.status += "\n\nPreamble:\t" + me.getPreamble();
}
var child1:NotesMIMEEntity = me.getFirstChildEntity();
while (child1 != null) {
requestScope.status += "\n\n*Content of child*";
requestScope.status += "\n" + child1.getContentAsText();
var child2:NotesMIMEEntity = child1.getFirstChildEntity();
if (child2 == null) {
child2 = child1.getNextSibling();
if (child2 == null) {
child2 = child1.getParentEntity();
if (child2 != null) child2 = child2.getNextSibling();
}
}
child1 = child2;
}
} else {
requestScope.status += "\n\n*Content*";
requestScope.status += "\n" + me.getContentAsText();
}
} else {
requestScope.status += "\nNot mime"
}
} else {
requestScope.status = "No match";
}
session.setConvertMime(true); // Restore MIME setting