createReplyMessage (NotesDocument - JavaScript™)
Creates a new document that is formatted as a reply to the current document.
Defined in
NotesDocumentSyntax
createReplyMessage(toall:boolean) : NotesDocument
Parameter | Description |
---|---|
toall |
If true, the new document recipient list contains all the recipients of the original. If false, the new document recipient list contains only the sender of the original. |
Return value | Description |
---|---|
NotesDocument |
A reply to the current document. |
Usage
The new document does not contain aSubject
item.
If you want one, the program must explicitly add it to the document.The new document does not automatically get mailed. If you want to mail it, the program must explicitly call the send method.
Examples
This button sends a reply message for each document in a mail folder.try {
var dbdir:NotesDbDirectory = session.getDbDirectory(null);
var db:NotesDatabase = dbdir.openMailDatabase();
requestScope.status = db.getTitle() + " on " + db.getServer() + " is " + (db.isOpen() ? "open" : "not open");
var view:NotesView = db.getView("FiledButNotForgotten");
if (view == null) {
requestScope.status += "\nCould not open folder";
return;
}
requestScope.status += "\nOpened folder " + view.getName();
var doc:NotesDocument = view.getFirstDocument();
while (doc != null) {
var reply:NotesDocument = doc.createReplyMessage(false);
var subject = doc.getItemValueString("Subject");
reply.replaceItemValue("Subject", "\nCan't work on this now: " + subject);
reply.replaceItemValue("Body", "This has been filed for future consideration.");
reply.send();
requestScope.status += "\nreplied to " + subject;
var tmpdoc = view.getNextDocument(doc);
doc.recycle(); // recycle to avoid memory problems
doc = tmpdoc;
}
} catch(e) {
requestScope.status += e.toString();
}