Meeting Invitation using Access (VBA) code

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

Subject: Meeting Invitation using Access (VBA) code

How do I not “delegate” the meeting and add the person as a required attendee?

With this code I do not see the meeting notice in my calendar.

Please help

Subject: RE: Meeting Invitation using Access (VBA) code

Ok, I was able to correct the delagation part, but the meeting still does not appear in my calendar, only the receipients. How do I correct this?

Subject: Try saving it to the mail file

A very quick scan of the code shows that you can craft a nice invite to send but you do not actually save it into the mail file; you just send it to the invitees. You need to save a copy in your mail file as well as sending the invitation.

Please note that a meeting invite is similar to a meeting on the Calendar but there are differences (e.g. Form is different, etc). You cannot just save the doc you just mailed and call it good. You will need to make some item adjustments first.

For details on what kinds of things to change I will refer you to the C&S Schema doc for what items are or are not on different Calendar docs.

Bruce

IBM

Subject: RE: Meeting Invitation using Access (VBA) code

Hi Jeremy, I was using this code to generate a Meeting with invitations and I’m having a problem on the Save command, were you able to resolve the issue?, if so can you share the code?, I’ve already read the C&S schema but still cant solve it, looks that the attendees receive the invitations and if they accept it place it in their Calendars but myself as Chair indicates that the meeting is accepted by me but is not in my calendar