Can i email anniversary entries to my users?

HiI thought this would be really easy - to write a script to send out Anniversary entries to all my users (they are important dates, but the anniversary type will do fine).

So I’ve written a simple script, setting all fields taken from the Properties box (see below).

BUT the Inbox removes the form=“Appointment” although the doc is sent with the form.

Has anyone managed to do this?

Another way to do this would be to create individual docs in each user’s mailfile… but that would seem much more complicated.

Any help appreciated, tia

Bryony


Sub Click(Source As Button)

Dim session As New notessession

Dim db As notesdatabase

Dim uiw As New notesuiworkspace

Dim uidoc As notesuidocument

Set uidoc = uiw.currentdocument

Dim server As String

Dim doc As notesdocument

Set doc=uidoc.document

Set db = session.currentdatabase

Dim newdoc As notesdocument

server=db.server

Set newdoc = db.createdocument

newdoc.form = "Appointment" 'the alias for a Calendar entry

newdoc.AppointmentType = "1"   'ie an Anniversary 

newdoc.Categories="Bank Holiday"

newdoc.Subject="Bank Holiday"

newdoc.EndDate=doc.date(0)

newdoc.EndTime="00.00.12"

newdoc.MeetingType="1"

newdoc.startdate=doc.date(0)

newdoc.starttime="00.00.12"

newdoc.CHAIR="test"

Dim e(1 To 2) As String

e(1)="D"

e(2)="S"

newdoc.excludefromview=e

'newdoc._viewicon="hol.gif"

g=uidoc.fieldgettext("mailgroup")

Call newdoc.send(True,g) 'true so as to send the form

Msgbox "Emails sent."

Call uidoc.save

Call uidoc.refreshhideformulas

End Sub

Subject: can i email anniversary entries to my users?

Why would populating the user’s mailfiles be that much more complicated?

All you have to do is to open the correct targetdb, then create a new document with the correct attibutes, save it et voilá. You seem already to have found what attributes to fill. The only thing you have to check is that you have enough access rights in the targetdb’s.

Subject: RE: can i email anniversary entries to my users?

Yes I take your point, I was hoping to avoid populating other dbs which don’t need my additions - group & mail-in dbs. Sending to ‘groups’ from the N&A book would have got around this very simply.I’ll work on adding my docs to all dbs in a directory.

thanks

B

Subject: RE: can i email anniversary entries to my users?

Orr something similar

JYR

Subject: RE: can i email anniversary entries to my users?

Folled your link but it doesn’t seem to have included any coding, just a picture… Guess I’ll have to do my own.thansk

B