Domino Designer Programming - COM Object - Meetings

Hello,

Can someone please provide me with some examples of how to create meetings (e.g. send invitations, accept/decline invitations, send updates etc.) using the COM object.

I am using the Domino Designer Progamming Guide Vol. 2 as a reference but I need some examples, even some pseudo code would be great.

thanks

Subject: Domino Designer Programming - COM Object - Meetings

Hi,

Below is a piece of code I used to create a calendar entry in another DB from the DB the code was run on. Hopefully this will give you a good starting point.

HTH

James

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace	

Dim maildb As notesdatabase

Dim entry As notesdocument

Dim db As notesdatabase

Dim uidoc As notesUIdocument

Dim doc As notesdocument

Dim CView As NotesView

Dim CDoc As NotesDocument

Dim CPath As String



Set db = session.currentdatabase

Set uidoc = workspace.currentdocument

Set doc = uidoc.document

Set CView = db.GetView("Config")

Set Cdoc = CView.GetDocumentByKey(4)

CPath = CDoc.C_Values(0)



Set maildb = session.getdatabase("Sever/Domain", CPath)



Set entry = maildb.createdocument

Dim startitem As NotesItem

Dim enditem As NotesItem

Dim starttime As NotesDateTime

Dim endtime As NotesDateTime

Dim totaltime As Integer



Set startitem = doc.GetFirstItem("StartDate")

Set enditem = doc.GetFirstItem("EndDate")

Set starttime = startitem.DateTimeValue

Set endtime = enditem.DateTimeValue

totaltime = endtime.timedifference(starttime) / 86400



entry.form = "Appointment"

entry.appointmenttype = "3"

entry.subject = doc.EventName(0)

entry.chair = session.UserName

entry.principal = session.UserName

entry.AltChair = session.UserName

entry.location = doc.location(0)	

entry.RequiredAttendees = doc.Required

entry.optionalAntendees = doc.Invited

entry.body = doc.Type(0) + " : " + doc.eventname(0) + ". " + doc.description(0)



entry.EnterSendTo = doc.required

entry.EnterCopyTo = doc.invited

entry.TxtNum = Cstr(doc.duration(0) + 1)



Set uidoc = workspace.editdocument(True, entry)

If totaltime = 0 Then

	Call uidoc.FieldSetText("StartDate", starttime.DateOnly)

	Call uidoc.FieldSetText("EndDate", endtime.DateOnly)

Else		

	Call uidoc.FieldSetText("StartDate", starttime.DateOnly)

	Call uidoc.FieldSetText("EndDate", Endtime.DateOnly)

	entry.Repeatfor = totaltime

	Entry.RepeatForUnit = "D"

	entry.RepeatInterval = "1"

	Call uidoc.FieldSetText("Repeats" ,"1")

	entry.repeatStartDate = starttime.LSLocalTime

	entry.repeatUnit = "D"

	entry.repeatUntil = endtime.LSLocalTime

End If





If doc.StartTime(0) = "" Then

	Call uidoc.FieldSetText("StartTime", "09:00:00")

Else

	Call uidoc.FieldSetText("StartTime",Cstr( doc.StartTime(0)))

End If



If doc.endtime(0) = "" Then

	Call uidoc.FieldSetText("EndTime", "17:00:00")

Else

	Call uidoc.FieldSetText("EndTime",Cstr( doc.endTime(0)))

End If



Call uidoc.FieldSetText("EndTime", "17:00:00")

Call uidoc.refresh

Call entry.ComputeWithForm(True, False)

Subject: RE: Domino Designer Programming - COM Object - Meetings

Hi James,

thanks for replying, i actually already have something working for appointments and recurring appointments, but not for meetings.

I build the meeting document in a similar way as you show, and try to send it by calling ndoc.Send(false, ref attendees), but when i try to open the invitation on the attendees account, it says Note Item not found.

What do I need to do for accepting a meeting invitation? Say I find the invitation programmatically, do I then create a response document, fill out the fields and send it? that’s what i’ve been trying but it’s not working as i would expect it to be, is there something i am missing?

thanks

-Tim