How to createClaender Item using COM interface

Hi,

I am new to the Domino.I have installed Domino server in a linux machine and installed admin client on a windows box and from the windows box I am running some python scripts to talk to domino server.

I am able to create dbs, users etc and also can create mails and send those mails using COM interface through python.But now I want to create some calendar item,to do item etc.How can I do that ? I could not find a way to use a form to create a Document.How to do that ?

Please help me.

Thanks

Somnath

Subject: Use the CreateDocument method

Use the CreateDocument method of the NotesDatabase object, and set the Form property to the type of document you want to create. Define your other basic fields (e.g. Subject, StartDate etc) and use the ComputeWithForm method to ensure that all the various computed fields are generated. Compare the fields in the documents generated this way with those manually created entries to make sure you have covered everything.

Subject: But there is no property called form

Hi ,

Thank you for the response.

I am using Python.

If I create a doc using createdocuments like

import os

from win32com.client import Dispatch

ses = Dispatch(‘Lotus.NotesSession’)

ses.Initialize(MY_NOTES_PASSWORD)

ndb=ses.GetDatabase(DominoServerName,“mail\bnas.nsf”)

if ndb.IsOpen == False :

print "It is not created"

print “Creating documents…”

for i in range(1,2):

aDoc=ndb.CreateDocument()

## Here I have to set the form properties

aDoc.Save(True,True)

There If I write aDoc.form = ‘Appointment’

then it throws a error like attribute error,::->

raise AttributeError, “Property ‘%s.%s’ can not be set.” % (self.username, attr)

AttributeError: Property ‘CreateDocument.form’ can not be set.

I used also aDoc.Form = ‘Appointment’ same error is being throwing.

I don’t think COM support extended class attributes.

Can you please give some example code.

Thanks

Somnath Naskar

Subject: Form is a NotesItem

Example LotusScript:

Dim item as NotesItem

Set item = doc.ReplaceItemValue( “Form” , “Appointment” )

or

doc.Form = “Appointment”

The form is just another field in your document. Maybe your code failed because you put the value in single- instead of double-quotes.

Subject: Use the Schema Luke…

If you are going to try and do anything Calendar (or R&R) related then you really should take some time to read up on the updated Calendaring & Scheduling Schema that we just posted so you can create valid docs that Notes will understand.

You can find it at http://www-10.lotus.com/ldd/ddwiki.nsf/dx/cs_schema_toc

Bruce

IBM