Iīm trying to set reminder in lotus notes using that code, all works fine except reminder.
Sub aaa()
Dim MailDbName As String
Dim strSTime As String
Dim strETime As String
Dim CalenDoc As Object
Dim NotesDB As Object
Dim MySession As Object
Dim ServerName As String
Dim Subject As String
Dim Body As String
Dim ApptDate As String
Dim StartTime As Date
Dim MinsDuration As Integer
Subject = "xxxxxxxxxxxxxx"
Body = "xxxxxxxxxxxxx"
ApptDate = "21.5.2013"
StartTime = "21.5.2013 13:30:00"
MinsDuration = 30
'ServerName = "YourServerName"
On Error GoTo SendNotesErr
DoCmd.Hourglass True
strSTime = CStr(FormatDateTime(StartTime, vbShortTime))
strETime = CStr(FormatDateTime(DateAdd("n", MinsDuration, StartTime), vbShortTime))
MailDbName = "mail\xxxxxxxxxxx.nsf"
Set MySession = CreateObject("Lotus.NotesSession")
If Not UserPassword = "~" Then
Call MySession.Initialize("xxxxxxxxxxx")
Else
Call MySession.Initialize
End If
Set NotesDB = MySession.GETDATABASE("xxxxx/xxxx/xxxxxxxxxx", MailDbName, False)
If Not NotesDB.IsOpen Then Exit Sub
Set CalenDoc = NotesDB.CreateDocument
CalenDoc.ReplaceItemValue "Form", "Appointment"
CalenDoc.ReplaceItemValue "AppointmentType", "4"
CalenDoc.ReplaceItemValue "STARTDATETIME", CDate(ApptDate & " " & strSTime)
CalenDoc.ReplaceItemValue "CALENDARDATETIME", CDate(ApptDate & " " & strSTime)
CalenDoc.ReplaceItemValue "EndDateTime", CDate(ApptDate & " " & strETime)
CalenDoc.ReplaceItemValue "Subject", Subject
CalenDoc.ReplaceItemValue "Body", Body
'CalenDoc.ReplaceItemValue "MeetingType", 1
CalenDoc.ReplaceItemValue "$Alarm", 1
CalenDoc.COMPUTEWITHFORM True, False
CalenDoc.Save True, False
SendNewNotesAppointment = True
DoCmd.Hourglass False
MsgBox "OK"
Exit Sub
SendNotesErr:
DoCmd.Hourglass False
SendNewNotesAppointment = False
End Sub
I have added this row into code, but itīs not working properly: CalenDoc.ReplaceItemValue "$Alarm", 1
I like to see reminder in selected time, like this Bez názvu.jpg
Thank you for helping.
Bookmarks