Hello All - I have an agent that creates a reminder in the curent users calendar just like I want it to. the client can open the document in read mode, but when the user tries to delete the reminder , an error pops that says “Error trying to open document: Type mismatch”.
Although the doc can be opened and saved, then deleted without the error. Is there any way to display exactly why this error displays or is there a way to force the back end scripts to avoid trhe error?
Sub Initialize
Dim dateTime As notesDateTime, popUpStr As String, subjectStr As String
Dim sess As New NotesSession
Dim ws As New notesuiworkspace
Set uidoc = ws.currentdocument
Set doc=uidoc.document
Dim userMailDb As New NotesDatabase( "", "" )
Call userMailDb.OpenMail
Dim user As String
user = sess.CommonUserName
Dim reminderDoc As New NotesDocument( userMailDb )
Dim DTItem As NotesItem
With reminderDoc
.Form = "Appointment"
.ReplaceItemValue "$Alarm", 1
.ReplaceItemValue "$AlarmDescription", popUpStr
.ReplaceItemValue "$AlarmMemoOptions", ""
.ReplaceItemValue "$AlarmOffset", 0
.ReplaceItemValue "$AlarmUnit", "M"
.ReplaceItemValue "$BorderColor", "D2DCDC"
.ReplaceItemValue "Categories", "Paid Time Off (PTO)"
.ReplaceItemValue "_ViewIcon", 10
.ReplaceItemValue "ExcludeFromView", "D"
.Subject = user
.Alarms = "1"
.tmpEventLabel = "Reminder"
.tmpChair = user
.StartDateTime = doc.PVFrom 'Cdat("02/01/2007 07:00:00 AM")'
.StartDate = doc.PVFrom 'Cdat("05/13/2003")
.EndDateTime = doc.PVTo 'Cdat("05/13/2003 07:00:00 AM")
.EndDate = doc.PVTo 'Cdat("05/13/2003")
.EndDate_2 = doc.PVTo 'Cdat("05/13/2003")
.StartTime = Cdat("07:00:00 AM")
.EndTime = Cdat("07:01:00 AM")
.Location = "Out Of Office"
.Body = doc.PVRequestText_C
.BookFreeTime = ""
.CalendarDateTime = doc.PVFrom 'Cdat("05/13/2003 07:00:00 AM")
.AppointmentType = 4
.ComputeWithForm False, False
.Save True, False
.PutInFolder( "$Alarms" )
Dim msg As String
msg = "An entry has been made in your calendar for this PV Request."
Messagebox msg, MB_OK, "Request Submitted - Reminder Created"
End With
End Sub