Creates a new NotesCalendar object.
Parameter |
Description |
maildatabase |
A standard Domino® mail
application, for example, an application based on the template StdR85Mail . |
Return value |
Description |
NotesCalendar |
The newly created NotesCalendar object. |
Examples
This button event gets calendar and
scheduling information for the current user for today and tomorrow.// Get calendar for current user
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);
var dt1:NotesDateTime = session.createDateTime("Today 08");
var dt2:NotesDateTime = session.createDateTime("Tomorrow 17");
// Read range and set to requestScope variable bound to multiline text box
requestScope.status = cal.readRange(dt1, dt2);
LotusScript® syntax
and examples
NotesSession.GetCalendar(maildatabase As NotesDatabase) As NotesCalendar
This
agent gets calendar and scheduling information for the current user
for today and tomorrow.Sub Initialize
Dim session As New NotesSession
Dim maildb As New NotesDatabase("", "")
Dim cal As NotesCalendar
Dim dt1 As NotesDateTime
Dim dt2 As notesdatetime
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesRichTextItem
REM Get calendar for current user
Call maildb.Openmail()
Set cal = session.getCalendar(maildb) ' Not In ref pane
Set dt1 = session.createdatetime("Today 08")
Set dt2 = session.Createdatetime("Tomorrow 17")
Set db = session.CurrentDatabase
REM Create document to post results
Set doc = db.CreateDocument
doc.Form = "main"
doc.Subject = "Today 08"
Set body = doc.Createrichtextitem("body")
REM Read range and put in body of document
Call body.Appendtext(cal.ReadRange(dt1, dt2))
Call doc.Save( True, True )
End Sub
Java™ syntax
and examples
NotesCalendar Session.getCalendar(Database maildatabase)
This
agent gets calendar and scheduling information for the current user
for today and tomorrow.import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
// Get calendar for current user
DbDirectory dbdir = session.getDbDirectory("");
Database maildb = dbdir.openMailDatabase();
NotesCalendar cal = session.getCalendar(maildb);
DateTime dt1 = session.createDateTime("Today 08");
DateTime dt2 = session.createDateTime("Tomorrow 17");
// Create document to post results
Database db = agentContext.getCurrentDatabase();
Document doc = db.createDocument();
doc.appendItemValue("Form", "main");
doc.appendItemValue("subject", "Today 08");
RichTextItem body = doc.createRichTextItem("body");
// Read range and put in body of document
body.appendText(cal.readRange(dt1, dt2));
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}