get the attendees' number of a meeting invitation in outlook

Need help with hardware, software, etc etc, or have some good info you would like to share. Post here.

Moderator: Guardians Knights

get the attendees' number of a meeting invitation in outlook

Postby Jomay » Mon May 15, 2017 10:52 pm

hey,

I was used to use outlook to send the meeting invitation. But as there are too many attendees, I forget to add some attendees when sending the invitation by mistake. It's really bad.

So I'm thinking if outlook can give a reminder with the number of attendees before I send the meeting invitation , so that I can check it again before I send it. Any Ideas?
Random avatar
Jomay
Peasant(newbie)
Peasant(newbie)
 
Topic author
Posts: 1
Joined: Mon May 15, 2017 10:03 pm
Gender: None specified

Re: get the attendees' number of a meeting invitation in out

Postby Yemiry » Fri May 19, 2017 5:28 am

hi,

You may use VBA codes to do that .

And I find a link which may be closed to what you want, see below

https://www.datanumen.com/blogs/auto-count-attendees-sending-meeting-invitation-outlook/

And I also attach the code here in case that the link may be invalid in the future

Code: Select all
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim objMeetingInvitation As Outlook.MeetingItem
    Dim objMeeting As Outlook.AppointmentItem
    Dim objAttendees As Outlook.Recipients
    Dim objAttendee As Outlook.recipient
    Dim lRequiredAttendeeCount, lOptionalAttendeeCount, lResourceCount As Long
    Dim strMsg As String
    Dim nPrompt As Integer
 
    If TypeOf Item Is MeetingItem Then
       Set objMeetingInvitation = Item
       Set objMeeting = objMeetingInvitation.GetAssociatedAppointment(True)
       Set objAttendees = objMeetingInvitation.Recipients
    End If
 
    lRequiredAttendeeCount = 0
    lOptionalAttendeeCount = 0
    lResourceCount = 0
 
    'Count the required & optional attendees and resources, etc.
    For Each objAttendee In objAttendees
         If objAttendee.Type = olRequired Then
            lRequiredAttendeeCount = lRequiredAttendeeCount + 1
         ElseIf objAttendee.Type = olOptional Then
            lOptionalAttendeeCount = lOptionalAttendeeCount + 1
         ElseIf objAttendee.Type = olResource Then
            lResourceCount = lResourceCount + 1
         End If
    Next
 
    'Double check the meeting invitation details
    strMsg = "Meeting Details:" & vbCrLf & vbCrLf & _
     "Required Attendees: " & lRequiredAttendeeCount & vbCrLf & _
     "Optional Attendees: " & lOptionalAttendeeCount & vbCrLf & _
     "Resources: " & lResourceCount & vbCrLf & _
     "Duration: " & GetDuration(objMeeting) & vbCrLf & vbCrLf & _
     "Are you sure to send this meeting invitation?"
 
    nPrompt = MsgBox(strMsg, vbExclamation + vbYesNo, "Double Check Meeting Invitation")
 
    If nPrompt = vbYes Then
       Cancel = False
    Else
       Cancel = True
    End If
End Sub

Function GetDuration(objCurMeeting As AppointmentItem) As String
    'Convert minute to hour
    If objCurMeeting.Duration > 60 Then
       GetDuration = Round(objCurMeeting.Duration / 60, 1) & " hours"
    ElseIf objCurMeeting.Duration = 60 Then
       GetDuration = Round(objCurMeeting.Duration / 60, 1) & " hour"
    ElseIf objCurMeeting.Duration < 60 Then
       GetDuration = objCurMeeting.Duration & " mins"
    End If
End Function


Good luck!
Random avatar
Yemiry
Peasant(newbie)
Peasant(newbie)
 
Posts: 1
Joined: Fri May 19, 2017 5:22 am
Gender: None specified


Return to Computer Tech

Who is online

Users browsing this forum: No registered users and 1 guest

cron