createRichTextItem (NotesDocument - JavaScriptâ„¢)
Creates a new rich-text item in a document.
Defined in
NotesDocumentSyntax
createRichTextItem(name:string) : NotesRichTextItem| Parameter | Description |
|---|---|
| name | The name of the new rich-text item. |
| Return value | Description |
|---|---|
| NotesRichTextItem | The newly created item. |
Usage
For more information, see the NotesRichTextItem class.Examples
This button creates a new document in the current database with a rich text item containing text and an attachment.try {
var doc:NotesDocument = database.createDocument();
doc.appendItemValue("Form", "main");
var image:string = requestScope.query;
doc.appendItemValue("Subject", image);
var rtitem:NotesRichTextItem = doc.createRichTextItem("Body");
rtitem.appendText("Attached is " + image + ".");
rtitem.addNewLine();
rtitem.embedObject(NotesEmbeddedObject.EMBED_ATTACHMENT, "", image, null);
doc.save();
requestScope.status = "Created document for image " + image;
} catch(e) {
requestScope.status = "Could not create document for image " + image;
}
Language cross-reference
CreateRichTextItem method in LotusScript® NotesDocument classcreateRichTextItem method in Java Document class