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