Has anyone successfully created a repeating meeting invitation from a custom application?
I’m trying to use LotusScript to send an invite to users’ calendars for meetings that repeat. My LotusScript function creates an invite document and calls NotesDocument.Send. It works when I don’t have repeating dates, but when the meeting does repeat over several days and I therefore set the fields as outlined by Cathy Duffy at
http://www-10.lotus.com/ldd/today.nsf/625c2f03e734191a85256468005e76f6/0ccdeddb57f8f8b9852564850058dc4f?OpenDocument then everything looks good until users click “Add To Calendar”. (I don’t want responses, so I set broadcast as “1” so “Add To Calendar” action is available instead of “Accept” and “Decline” options.)
When users click “Add To Calendar”, I get an “Item Not Found” messagebox that is thrown by the undocumented object Notes uses for its calendar logic. (GRRRRR)
Has anyone successfully done anything like this???
Subject: Answer: Needed $CSWISL, $SMTPKeepNotesItem, and/or $WatchedItems
In a fit of irresponsible flailing I copied a bit of code fromhttp://www-10.lotus.com/ldd/nd6forum.nsf/ResponsePrint?OpenForm&ParentUNID=82CB577C35762E9685256E540051757E
and EUREKA!!!
Specifically, the setting of $CSWISL, $SMTPKeepNotesItem, and/or $WatchedItems, was key.
Strangely, none of the above fields were required when simply creating a non-repeating meeting invite.
Here’s the code I wrote:
Sub SetRepeatInfo(docSource As NotesDocument, docMail As NotesDocument, ndtStart As NotesDateTime, ndtEnd As NotesDateTime)
Dim andtRepeatDates() As NotesDateTime
Dim andtRepeatEndDates() As NotesDateTime
Dim i As Integer
Dim iDays As Integer
Dim ndt As NotesDateTime
Dim u As Integer 'ubound(andtRepeatDates). iDays - 1
iDays = docSource.PlannedDays(0)
If iDays < 2 Then Exit Sub
u = iDays - 1
Redim andtRepeatDates(u)
Redim andtRepeatEndDates(u)
For i = 0 To u
Set ndt = New NotesDateTime(ndtStart.ZoneTime)
Call ndt.AdjustDay(i)
Set andtRepeatDates(i) = ndt
Set ndt = New NotesDateTime(ndtEnd.ZoneTime)
Call ndt.AdjustDay(i)
Set andtRepeatEndDates(i) = ndt
Next
With docMail
.ReplaceItemValue "$CSFlags", "m"
.ReplaceItemValue "OrgRepeat", "1"
.ReplaceItemValue "RepeatDates", andtRepeatDates
.ReplaceItemValue "RepeatEndDates", andtRepeatEndDates
.ReplaceItemValue "RepeatFor", iDays
.ReplaceItemValue "RepeatForUnit", "D"
.ReplaceItemValue "RepeatHow", "F"
.ReplaceItemValue "RepeatInterval", "1"
.ReplaceItemValue "RepeatStartDate", ndtStart
.ReplaceItemValue "RepeatUnit", "D"
.ReplaceItemValue "RepeatWeekends", "D"
REM Have no idea if these are needed or not
.ReplaceItemValue "$HFFlags", "1"
.ReplaceItemValue "RepeatAdjust", ""
.ReplaceItemValue "RepeatCustom", ndtStart
.ReplaceItemValue "Repeats", "1"
.ReplaceItemValue "RepeatUntil", andtRepeatDates(u)
REM I have no idea WHY, but one of the following three fields are necessary
Dim atCSWISL (0 To 4) As String
atCSWISL(0)="$S:1"
atCSWISL(1)="$L:1"
atCSWISL(2)="$B:1"
atCSWISL(3)="$R:1"
atCSWISL(4)="$E:1"
.ReplaceItemValue "$CSWISL", atCSWISL
.ReplaceItemValue "$SMTPKeepNotesItem", "1"
Dim atWatched (0 To 4) As String
atWatched(0)="$S"
atWatched(1)="$L"
atWatched(2)="$B"
atWatched(3)="$R"
atWatched(4)="$E"
.ReplaceItemValue "$WatchedItems", atWatched
End With
End Sub
Subject: Also needed: $CSVersion / $CSTrack
Tried the same thing in one of our applications. Didn’t work until I added two more fields:
Call maildoc.ReplaceItemValue( “$CSVersion”, “2” )
Dim strCSTrack(1) As String
strCSTrack(0) = “Send Request by Notes Client on Some User/ORG/DE(Release 6.5.4|March 27, 2005) at 01.08.2006 11:53:50”
strCSTrack(1) = “Prepare Request by Notes Client on Some User/ORG/DE(Release 6.5.4|March 27, 2005) at 01.08.2006 11:53:50”
Call maildoc.ReplaceItemValue( “$CSTrack”, strCSTrack )
Now it runs like a charm … after much cursing on my side!
Cheers,
Mike
Subject: LOL! Re: Answer: Needed $CSWISL, $SMTPKeepNotesItem, and/or $WatchedItems
“In a fit of irresponsible flailing I copied a bit of code…”
I was going to suggest those various fields, but I just had to say that this had me laughing for about 20 minutes!
Subject: RE: LOL!
Heh. Thanks. I’m sure we all know how that feels some times.
Grr.
Subject: Answer #2
FYI: The Chair field cannot be the recipient of the message or the code simply won’t work.