carolmanente
New Member
- Joined
- Dec 18, 2017
- Messages
- 4
Hi,
I found on internet a code that send a calendar entry meeting in Lotus Notes.
The code works, but when I put more than one attendee, it send only to the first person in the cell. For instance, in image below on the B2 cell there is two e-mails: xx@nda.com and dd@nda.com separeted by semicolon. The meeting entry sent only to xx@nda.com. How can I send to multiple attendees?
Here is the code:
If someone can help me, I will be eternal grateful.
I found on internet a code that send a calendar entry meeting in Lotus Notes.
The code works, but when I put more than one attendee, it send only to the first person in the cell. For instance, in image below on the B2 cell there is two e-mails: xx@nda.com and dd@nda.com separeted by semicolon. The meeting entry sent only to xx@nda.com. How can I send to multiple attendees?
Here is the code:
Code:
Sub LotusMeeting()
Dim EmailList As Variant
Dim session, db, NotesDoc As Object
Dim server, mailfile, user As String
Dim strETime As Date
Dim NDTstart As Object
Dim NDTend As Object
Dim EndTime As Date
Dim StartTime As Date
Dim MinsDuration As Integer
Dim ProcessOwner As String
Dim ClientOwner As String
Dim MSubject As String 'Variable for storing meeting subject
Dim TempSubject As String
Dim Body As Variant
'Picks up the Endtime from the ExcelSheet
StartTime = Cells(5, 2)
MinsDuration = Cells(5, 6)
Body = Cells(7, 2)
'Picks up the Attendees Name from the ExcelSheet
ClientOwner = Cells(2, 2)
ClientOwner = ClientOwner '& "@yourdomain.com"
ProcessOwner = Cells(3, 2)
ProcessOwner = ProcessOwner '& "@yourdomain.com"
'Picks up the Subject of the meeting from the ExcelSheet
MSubject = Cells(4, 2)
Set session = CreateObject("Notes.NotesSession") 'Initializing Notes Session
user = session.UserName 'Current User Name
server = session.GetEnvironmentString("MailServer", True) 'User's mailing server name
mailfile = session.GetEnvironmentString("MailFile", True) 'User's mailing file path
Set db = session.GETDATABASE(server, mailfile) 'Get Handle of User's Mailing Database
'Creating Meeting Document - Send to the invitees
Set NotesDoc = db.CREATEDOCUMENT
strETime = FormatDateTime(DateAdd("n", MinsDuration, StartTime))
NotesDoc.ReplaceItemValue "Form", "Notice"
NotesDoc.ReplaceItemValue "NoticeType", "I"
NotesDoc.ReplaceItemValue "DispDur_2", MinsDuration
NotesDoc.ReplaceItemValue "Chair", user
NotesDoc.ReplaceItemValue "AltChair", user
NotesDoc.ReplaceItemValue "Topic", MSubject
TempSubject = "Invitation:" & MSubject & " (" & CStr(Format(StartTime, "mmm")) & " " & CStr(Format(StartTime, "d")) & " "
TempSubject = TempSubject & " " & CStr(Format(StartTime, "hh:mm AM/PM")) & ")"
NotesDoc.ReplaceItemValue "Subject", TempSubject
NotesDoc.ReplaceItemValue "Body", Body
NotesDoc.ReplaceItemValue "MeetingType", 1
NotesDoc.ReplaceItemValue "AppointmentType", "3"
NotesDoc.ReplaceItemValue "$PublicAccess", "1"
NotesDoc.ReplaceItemValue "StartTime", StartTime 'Start time of the meeting
NotesDoc.ReplaceItemValue "StartDateTime", StartTime
NotesDoc.ReplaceItemValue "CalendarDateTime", StartTime
NotesDoc.ReplaceItemValue "EndDateTime", strETime
NotesDoc.ReplaceItemValue "EndTime", strETime 'End time of the meeting
NotesDoc.SAVEMESSAGEONSEND = False
NotesDoc.ReplaceItemValue "SendTo", ClientOwner
NotesDoc.ReplaceItemValue "RequiredAttendees", ClientOwner
NotesDoc.ReplaceItemValue "CopyTo", ProcessOwner
NotesDoc.ReplaceItemValue "OptionalAttendees", ProcessOwner
NotesDoc.ReplaceItemValue "_ViewIcon", 133
NotesDoc.computeWithForm True, False
Call NotesDoc.Send(False)
'Modifying Meeting Document for saving in user's mail file
NotesDoc.ReplaceItemValue "Form", "Appointment"
NotesDoc.ReplaceItemValue "_ViewIcon", 158
NotesDoc.ReplaceItemValue "tmpOwnerHW", "0"
NotesDoc.ReplaceItemValue "Subject", MSubject
Call NotesDoc.RemoveItem("NoticeType")
Call NotesDoc.RemoveItem("AppointmentType")
NotesDoc.computeWithForm True, False
Call NotesDoc.Save(False, False)
'Closing objects to free memory
Set session = Nothing
Set db = Nothing
Set NotesDoc = Nothing
MsgBox ("Your Notes Meeting request has been sent successfully...It's most likely time to switch to a new email client")
End Sub
Last edited by a moderator: