Putting an entry into the calendar

Hi,

I would like to create an entry in the calendar

so that I can see it when I open up the calendar. I want to do this using lotus script.

When the user accepts a meeting, I want to add another meeting.

For simplicity sake, I have made it so that when the user hits the response/accept,

I get the notes document and create a new document

incrementing the day by one.

So I expect to go to the calendar and see two

meetings. The original one, and one for the day

after.

Here is the code I am trying to do this with, which I would have thought would work,

but I think I am missing one last piece. I would be very grateful if you have the time to take a

look and suggest anything.

Dim theSession As New NotesSession

Dim db As NotesDatabase

Set note = cseventobj.m_ws.currentdocument.document

Dim nextNote As NotesDocument

Set nextNote = New NotesDocument( db )

Call note.CopyAllItems(nextNote, True)

’ add a day to the dates

Dim initialStartDate As String

Dim initialEndDate As String

initialStartDate = nextNote.StartDate(0)

initialEndDate = nextNote.EndDate(0)

’ add one day to the initialStart Date

Dim dtStartDate As New NotesDateTime(initialStartDate)

Dim dtEndDate As New NotesDateTime(initialEndDate)

Call dtStartDate.AdjustDay(1)

Call dtEndDate.AdjustDay(1)

’ need to convert back to text

Dim stringStart, stringEnd

stringStart = dtStartDate.localtime

stringEnd = dtEndDate.localTime

’ set item in nextNote

Dim item As NotesItem

Set item = nextNote.replaceItemValue(“StartDate”, stringStart)

Set item = nextNote.ReplaceItemValue(“EndDate”, stringEnd)

’ save the item in the database

nextNote.Save True, True, True

Josie

Subject: Putting an entry into the calendar

I figured this out, so thought I’d share my results in case anyone else needs it.

I was basically doing the correct thing, but a quick read of the excellent document from Iris Associates

http://www-10.lotus.com/ldd/today.nsf/8a6d147cf55a7fd385256658007aacf1/643ef8419b72f66f85256485005505bc/$FILE/c&s.pdf

Showed me that I was missing a field that you need if you want to show up in the calendar.

I added

Set item = nextNote.ReplaceItemValue(“CalendarDateTime”, dtStartDate)

and my entries are showing up in the calendar.

Josie