VBA Lotus Notes Calendar Entry Meeting - Multiple Attendees

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:

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
If someone can help me, I will be eternal grateful.
 
Last edited by a moderator:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Below is the image. I forgot to put on the first post.

548055d1510850809-vba-lotus-notes-calendar-entry-meeting-multiple-attendees-image.png
 
Upvote 0
Try changing these lines, as shown:
Code:
    NotesDoc.ReplaceItemValue "SendTo", Split(ClientOwner, ";")
    NotesDoc.ReplaceItemValue "RequiredAttendees", Split(ClientOwner, ";")
    NotesDoc.ReplaceItemValue "CopyTo", Split(ProcessOwner, ";")
    NotesDoc.ReplaceItemValue "OptionalAttendees", Split(ProcessOwner, ";")
 
Upvote 0
try changing these lines, as shown:
Code:
    notesdoc.replaceitemvalue "sendto", split(clientowner, ";")
    notesdoc.replaceitemvalue "requiredattendees", split(clientowner, ";")
    notesdoc.replaceitemvalue "copyto", split(processowner, ";")
    notesdoc.replaceitemvalue "optionalattendees", split(processowner, ";")

it works!! Thank you soooooooo much!! <3
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top