getNextEntity (NotesMIMEEntity - JavaScript)

Returns the MIME entity immediately following the current MIME entity within a multipart entity.

Defined in

NotesMIMEEntity

Syntax

getNextEntity() : NotesMIMEEntity

getNextEntity(search:int) : NotesMIMEEntity

Parameter Description
search
  • NotesMIMEEntity.SEARCH_DEPTH (1724) (default) searches for child entities first then siblings.
  • NotesMIMEEntity.SEARCH_BREADTH (1723) searches for siblings first then child entries.
Return value Description
NotesMIMEEntity The next MIME entity, or null.

Examples

This button gets all the children at the end of the last branch of a multipart entity by searching breadth first.
// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var mime:NotesMIMEEntity = currentDocument.getDocument().getMIMEEntity();
if (mime != null) {
	// Drill down to last child at bottom of first branch
	var child:NotesMIMEEntity = mime.getNextEntity(NotesMIMEEntity.SEARCH_BREADTH);
	while (child != null) {
		mime = child;
		child = mime.getNextEntity(NotesMIMEEntity.SEARCH_BREADTH);
	}
	// Get content of all children at bottom level
	// of first branch in reverse order
	while (mime != null) {
		requestScope.status += mime.getContentAsText() + "\n";
		mime = mime.getPrevSibling();
	}
} else {
	requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);