ContentAsText (NotesMIMEEntity - JavaScript)

Read-only. The content of a MIME entity in text format.

Defined in

NotesMIMEEntity

Syntax

getContentAsText() : string

Usage

No data conversion occurs except a non-encoded text entity that is not US-ASCII is converted to Unicode. Non-text data returns as is which may present problems in further manipulation. For example, data containing a null character will probably be truncated at the null character during string manipulation.

For the parent entity in a multipart entity, this property returns the preamble. See Preamble.

To get the MIME content as text in a NotesStream object, see getContentAsText.

The signature for this property has the same name as the signatures for the getContentAsText method.

Examples

This button gets the MIME content from the current document.
var doc:NotesDocument = currentDocument.getDocument();
var mime:NotesMIMEEntity = doc.getMIMEEntity();
if (mime != null) {
	var m:string = "Content type: " + mime.getContentType() + "\n" +
	"Content subtype: " + mime.getContentSubType() + "\n" +
	"Character set: " + mime.getCharset() + "\n" +
	"Encoding: " + mime.getEncoding();
	requestScope.status = doc.getItemValueString("Subject") + "\n" + m + "\n" +
	mime.getHeaders() + "\n" + mime.getContentAsText();
} else {
	requestScope.status = "Not MIME - " + doc.getItemValueString("Subject");
}
This button sets the value of a rich text control (bound to requestScope.body) with the value of a rich text item (body) in the current document.
var doc:NotesDocument = currentDocument.getDocument();
if (doc.hasItem("body")) {
	var entity:NotesMIMEEntity = doc.getMIMEEntity("body");
	if (entity != null) {
		requestScope.body = entity.getContentAsText();
	}
}