I have some code in an application which creates and sends a meeting invitation. In Notes everything works as expected, in other mail clients (specifically Gmail and Outlook) I'm having an issue I have not been able to resolve. In the creation of the invitation I'm setting $PreventReplies = "1" which per the documentation "Indicates whether or not Chair wants replies back" and set to 1 indicates that no reply is to be sent. What this means is that when a user accepts/declines the invitation or any updates to it the chair does NOT get updated (this is what I need).
The issue is that in both Gmail and Outlook when the user accepts the invitation a reply IS sent to the chair.
Here is the routine for anyone wanting to see the whole thing.
Sub SendNotes(scheduleDoc As NotesDocument, currUserName As String, whatAction)
' Send a Calendar Appointment invitiation using Notes style Calendaring and Scheduling built-in the mail template
Dim SendTo As String ' A comma separated string
Dim CopyTo As String ' A comma separated string
Dim language As String
Dim invitation As NotesDocument
Dim startdttm As NotesDateTime
Dim enddttm As NotesDateTime
Dim rtitem As NotesRichTextItem
Dim tasktype As String
Dim tmpItem As NotesItem
SendTo = Join(scheduleDoc.CalEntryInvitees, ",")
CopyTo = ""
language = "en-US"
Set invitation = New NotesDocument(scheduleDoc.ParentDatabase)
With invitation
.ReplaceItemValue "$altPrincipal", currUserName
.ReplaceItemValue "$CSVersion", "2"
.ReplaceItemValue "$FromPreferredLanguage", language
.ReplaceItemValue "$PreventReplies", "1" ' Indicates whether or not Chair wants replies back
.ReplaceItemValue "$PublicAccess", "1"
.ReplaceItemValue "$SignatureStatus", "0"
.ReplaceItemValue "$SMTPKeepNotesItems", "1"
.ReplaceItemValue "AppointmentType", "3"
.ReplaceItemValue "Chair", currUserName
.ReplaceItemValue "Encrypt", "0"
.ReplaceItemValue "Form", "Notice"
.ReplaceItemValue "Location", scheduleDoc.CalEntryLocDefault(0)
.ReplaceItemValue "PreventCounter", "1" ' Prevents the user from proposing a different meeting date/time
.ReplaceItemValue "PreventDelegate", "1" ' Prevents the user from delegating this meeting to someone else
.ReplaceItemValue "Principal", currUserName
Set tmpItem = New NotesItem(invitation, "RequiredAttendees", Split(SendTo, ","), NAMES)
tmpItem.IsSummary = True
Set tmpItem = New NotesItem(invitation, "SendTo", Split(SendTo, ","), NAMES)
tmpItem.IsSummary = True
If CopyTo = "" Then
.ReplaceItemValue "CopyTo", ""
Else
Set tmpItem = New NotesItem(invitation, "CopyTo", Split(CopyTo, ","), NAMES)
tmpItem.IsSummary = True
End If
.ReplaceItemValue "StorageRequiredNames", "1"
' Compute the Date and time fields
Set startdttm = New NotesDateTime(Trim(scheduleDoc.StartDate(0) & " " & scheduleDoc.StartTime(0)))
Set enddttm = New NotesDateTime(Trim(scheduleDoc.EndDate(0) & " " & scheduleDoc.EndTime(0)))
Set invitation.StartDateTime = startdttm
invitation.StartDate = startdttm.DateOnly
invitation.StartTime = startdttm.TimeOnly
invitation.StartTimeZone = Evaluate({@GetCurrentTimeZone})
Set invitation.EndDateTime = enddttm
invitation.EndDate = enddttm.DateOnly
invitation.EndTime = enddttm.TimeOnly
invitation.EndTimeZone = Evaluate({@GetCurrentTimeZone})
Select Case whatAction
Case "SAVE"
' Send first time invitation
.ReplaceItemValue "$CSWISL", Evaluate({@Explode("$S:1;$L:1;$B:1;$R:1;$E:1;$W:1;$O:1;$M:1;RequiredAttendees:1;INetRequiredNames:1;AltRequiredNames:1;StorageRequiredNames:1;OptionalAttendees:1;INetOptionalNames:1;AltOptionalNames:1;StorageOptionalNames:1"; ";")})
.ReplaceItemValue "$HFFlags", "1"
.ReplaceItemValue "$IconSwitcher", "Meeting"
.ReplaceItemValue "$NameLanguageTags", Left(language, 2)
.ReplaceItemValue "$StorageCc", ""
.ReplaceItemValue "$StorageTo", "1"
.ReplaceItemValue "$TableSwitcher", "Description"
.ReplaceItemValue "$WatchedItems", Evaluate({@Explode("$S;$L;$B;$R;$E;$W;$O;$M;RequiredAttendees;INetRequiredNames;AltRequiredNames;StorageRequiredNames;OptionalAttendees;INetOptionalNames;AltOptionalNames;StorageOptionalNames"; ";")})
.ReplaceItemValue "ApptUNID", .UniversalID
.ReplaceItemValue "IsBroadcast", "0"
.ReplaceItemValue "Logo", "StdNotesLtr25"
.ReplaceItemValue "NoticeType", "I"
.ReplaceItemValue "OrgTable", "C0"
.ReplaceItemValue "SchedulerSwitcher", "1"
.ReplaceItemValue "Sign", ""
.ReplaceItemValue "subject", "Invitation: " + scheduleDoc.SubjectText(0) + "(" + startdttm.DateOnly + " " + startdttm.TimeOnly + " in " + scheduleDoc.CalEntryLocDefault(0) + ")"
.ReplaceItemValue "topic", "Invitation: " + scheduleDoc.SubjectText(0)
.ReplaceItemValue "SequenceNum", scheduleDoc.SequenceNum(0)
.ReplaceItemValue "UpdateSeq", scheduleDoc.UpdateSeq(0)
.ReplaceItemValue "_ViewIcon", 133
Case "CHANGE"
' Send notice update
.ReplaceItemValue "$CSFlags", "w"
Dim updateSeq As String
updateSeq = CStr(scheduleDoc.UpdateSeq(0))
Print updateSeq
.ReplaceItemValue "$CSWISL", Split("$L:1;$R:1;$E:1;$W:1;$O:1;$M:1;RequiredAttendees:1;INetRequiredNames:1;AltRequiredNames:1;StorageRequiredNames:1;OptionalAttendees:1;INetOptionalNames:1;AltOptionalNames:1;StorageOptionalNames:1;$S:" & updateSeq & ";$B:" & updateSeq, ";")
Call .MakeResponse(invitation.ParentDatabase.GetProfileDocument("(CalendarProfile)"))
Set tmpItem = .GetFirstItem("$REF")
ForAll v In tmpItem.Values
v = scheduleDoc.meetingdocid(0)
End ForAll
.ReplaceItemValue "$REFOPTIONS", "1"
.ReplaceItemValue "ApptUNID", scheduleDoc.meetingdocid
.ReplaceItemValue "NoticeType", "U"
.ReplaceItemValue "subject", "Update: " + scheduleDoc.SubjectText(0)
.ReplaceItemValue "topic", "Update: " + scheduleDoc.SubjectText(0)
.ReplaceItemValue "SequenceNum", scheduleDoc.SequenceNum(0)
.ReplaceItemValue "UpdateSeq", scheduleDoc.UpdateSeq(0)
.ReplaceItemValue "_ViewIcon", 33
.ReplaceItemValue "$Abstract", scheduleDoc.Comments(0)
Case "DELETE"
' Send cancellation notice
.ReplaceItemValue "$CSFlags", "w"
updateSeq = CStr(scheduleDoc.UpdateSeq(0))
Print updateSeq
.ReplaceItemValue "$CSWISL", Split("$L:1;$R:1;$E:1;$W:1;$O:1;$M:1;RequiredAttendees:1;INetRequiredNames:1;AltRequiredNames:1;StorageRequiredNames:1;OptionalAttendees:1;INetOptionalNames:1;AltOptionalNames:1;StorageOptionalNames:1;$S:" & updateSeq & ";$B:" & updateSeq, ";")
Call .MakeResponse(invitation.ParentDatabase.GetProfileDocument("(CalendarProfile)"))
Set tmpItem = .GetFirstItem("$REF")
ForAll v In tmpItem.Values
v = scheduleDoc.meetingdocid(0)
End ForAll
.ReplaceItemValue "$REFOPTIONS", "1"
.ReplaceItemValue "ApptUNID", scheduleDoc.meetingdocid
.ReplaceItemValue "NoticeType", "C"
.ReplaceItemValue "subject", "Cancelled: " + scheduleDoc.SubjectText(0)
.ReplaceItemValue "topic", "Cancelled: " + scheduleDoc.SubjectText(0)
.ReplaceItemValue "SequenceNum", scheduleDoc.SequenceNum(0)
.ReplaceItemValue "UpdateSeq", scheduleDoc.UpdateSeq(0)
.ReplaceItemValue "_ViewIcon", 81
Case Else
' Error getting the whatAction, define an error then go to ErrorHandler
MessageBox "No action was found, please report this issue to the support center.", 0+16+0+0, "No Action Performed"
Exit Sub
End Select
End With
' Set the Body RT field
Set rtitem = New NotesRichTextItem(invitation, "Body" )
With rtItem
.AppendText(scheduleDoc.Comments(0))
End With
' Send the invitation
Invitation.Send(False)
End Sub