The following code will show you how to add an entry in a Lotus Notes Calendar with C#
using Domino;
...
try
{
Domino.NotesSession LNSession = new Domino.NotesSession();
Domino.NotesDatabase LNDatabase;
Domino.NotesDocument LNDocument;
LNSession.Initialize("password");
LNDatabase = LNSession.GetDatabase("Notes-Server", "mail\\user.nsf", false);
LNDocument = LNDatabase.CreateDocument();
System.DateTime StartDate = new DateTime(2008, 3, 19, 8, 2, 0);
System.DateTime EndDate = new DateTime(2008, 3, 19, 8, 5, 0);
LNDocument.ReplaceItemValue("Form", "Appointment");
LNDocument.ReplaceItemValue("AppointmentType", "0");
LNDocument.ReplaceItemValue("Subject", "hello world");
LNDocument.ReplaceItemValue("$PublicAccess","1");
LNDocument.ReplaceItemValue("CALENDARDATETIME", StartDate);
LNDocument.ReplaceItemValue("StartDateTime", StartDate);
LNDocument.ReplaceItemValue("EndDateTime", EndDate);
LNDocument.ReplaceItemValue("StartDate", StartDate);
LNDocument.ReplaceItemValue("MeetingType", "1");
LNDocument.ReplaceItemValue("Body", "Body Text Body Text ...");
LNDocument.ReplaceItemValue("$Alarm", 1);
LNDocument.ReplaceItemValue("$AlarmDescription", "hello world (alarm)");
LNDocument.ReplaceItemValue("$AlarmMemoOptions", "" );
LNDocument.ReplaceItemValue("$AlarmOffset", 5);
LNDocument.ReplaceItemValue("$AlarmSound", "tada");
LNDocument.ReplaceItemValue("$AlarmUnit", "M");
LNDocument.ComputeWithForm(true, false);
LNDocument.Save(true, false, false);
MessageBox.Show("Calendar Entry Successfully Added!", "Info",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.