Add doc calendar (LS)

HI

I try to add a appointment with multiple days for vacation in the Notes user Calendar.

here the code

Sub Click(Source As Button)

Dim NotesSession As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim Doc As NotesDocument

Dim db As NotesDatabase

Dim UIDoc As NotesUIDocument  

Dim CurDoc As NotesDocument

Dim dbMail As New NotesDatabase( "", "" )



Dim serveur As String



Call dbMail.OpenMail

serveur = dbMail.Server



Set CurDoc = workspace.CurrentDocument.Document

Set db = NotesSession.GetDatabase(serveur,CurDoc.Calendar(0))

Set doc = db.CreateDocument



doc.form = "Appointment"

doc.Subject = "Vacation. (Approved by " & CurDoc.Manager(0) & ") "

Msgbox Str(CurDoc.StartDate(0)) & Chr(13) & Str(CurDoc.CalDays(0))

doc.StartDateTime = CurDoc.StartDate(0)

’ doc.EndDateTime = CurDoc.EndDate(0)

doc.AppointmentType = "2"

doc.Duration = CurDoc.CalDays(0)

doc.ExcludeFromView = "D"

Set UIDoc = Workspace.EditDocument(True,doc)

End Sub

The result when I open the Appointment, I have only the day of today (startDate & EndDate)

For 24 march 2008 to 6 april 2008 I have these values in the MSGBox (so it’s correct!):

24/03/2008

14

what’s wrong?

also… I search a similar problem in the forum but it’s not correct my problem…:

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/391bbf29227d3f7b852572570071bc03?OpenDocument

Thanks in advance

Subject: Add doc calendar (LS)

When you add a multiple day event (vacation) you need to create multiple documents.

Take a look at this documentation:

http://www-12.lotus.com/ldd/doc/uafiles.nsf/docs/WPNotesCSSchema/$File/csschema.pdf