Hi All,
I hope this is the right place to get answer for my question. I want to send a meeting invitation using MS Access VBA code. I got success till sending meeting to invitees. After accepting my meeting invitation by Invitee then I am not getting any Accepted email and also not updating invitee Calender.
Can you please help me. Here is my code:
Private Sub CMD_EMAIL_MTG_NOTICE_Click()
On Error GoTo Err_CMD_EMAIL_MTG_NOTICE_Click
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As Object 'The current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim session As Object 'The notes session
Dim Subject As String 'The subject string
Dim ReturnReceipt As String 'The ReturnReceipt string
Dim Recipient As String 'The Recipient string (or you could use the list)
Dim Recip(10) As Variant 'The Recipient list
Dim BodyText As String 'The body text
Dim SaveIt As Boolean 'Save to sent mail
Dim WasOpen As Integer 'Checking to see if the Mail DB was already
Dim dblocation As String
Dim arrEmailIds() As String
Dim i As Integer
Dim strMessage As String
Dim strMessage2 As String
strMessage = MsgBox(“Do You Want To Email the XYZ Meeting Notice?”, vbYesNo, “SEND Email Now?”)
If strMessage = vbYes Then
If getLotusNotesStatus("", 0) = False Then
MsgBox "Please open Lotus Notes and Login", vbInformation
Exit Sub
End If
Else
Exit Sub
End If
SaveIt = True
Set session = CreateObject("Notes.NotesSession")
'get the name of the mailfile of the current user
dblocation = session.GETENVIRONMENTSTRING("MailFile", True)
'Get the notesdatabase for the mail.
Set Maildb = session.GETDATABASE("", dblocation)
If Maildb.ISOPEN = True Then
WasOpen = 1 'Already open for mail
Else
Maildb.OPENMAIL 'This will prompt you for password
End If
Dim startDateTime
Dim endDateTime
Set startDateTime = session.CREATEDATETIME(Format(DCRB_SCHED_DATE, "mm/dd/yyyy") & " " &
Format(DCRB_SCHED_DATE, “hh:nn AMPM”))
Set endDateTime = session.CREATEDATETIME(Format(DCRB_SCHED_DATE, "mm/dd/yyyy") & " " & Format(DateAdd("n",
60, Format(DCRB_SCHED_DATE, “hh:nn AMPM”)), “hh:nn AMPM”))
'Set Mail Document Properties
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Appointment"
'2 - All Day Event
'4 - Remainder
'1 - Anniversary
'0 - Appointment
'3 - Meeting
MailDoc.AppointmentType = "3"
MailDoc.MeetingType = "1"
MailDoc.alarm = "1"
MailDoc.alarmoffset = "-30"
MailDoc.CALENDARDATETIME = Format(DCRB_SCHED_DATE, "mm/dd/yyyy")
MailDoc.startDateTime = startDateTime.LSLOCALTIME
MailDoc.endDateTime = endDateTime.LSLOCALTIME
MailDoc.StartDate_2 = Format(DCRB_SCHED_DATE, "mm/dd/yyyy")
MailDoc.StartTime_2 = Format(DCRB_SCHED_DATE, "hh:nn AMPM")
MailDoc.EndTime_2 = Format(DateAdd("n", 60, Format(DCRB_SCHED_DATE, "hh:nn AMPM")), "hh:nn")
MailDoc.EndDate_2 = Format(DCRB_SCHED_DATE, "mm/dd/yyyy")
MailDoc.DispDur_1 = "60"
MailDoc.Location = "Test
MailDoc.Subject = "Subject"
MailDoc.Body = "Body"
MailDoc.Alarms = "1"
MailDoc.Chair = "TATA"
MailDoc.ExcludefromView = "D"
MailDoc.ReturnReceipt = "1"
MailDoc.SAVEMESSAGEONSEND = SaveIt
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.COMPUTEWITHFORM True, False
MailDoc.SEND 0, "abc@xyz.com"
End If 'emailto <> “”
Exit_CMD_EMAIL_MTG_NOTICE_Click:
Exit Sub
Err_CMD_EMAIL_MTG_NOTICE_Click:
MsgBox Err.DESCRIPTION
Resume Exit_CMD_EMAIL_MTG_NOTICE_Click
End Sub