Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim Ns As Outlook.NameSpace Set Ns = Application.GetNamespace("MAPI") Set Items = Ns.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub Items_ItemAdd(ByVal Item As Object) If InStr(1, Item.Subject, "Accepted: ") Then GoTo SendReply Else Exit Sub End If SendReply: Dim oRespond As Outlook.MailItem Dim RmSize As String Dim strSubject As String Dim arrSubject As Variant Dim arrRmSize As Variant Dim i As Long ' Set up the array; add more as needed ' one subject and one room size per meeting arrSubject = Array("Testing this meeting", "Testing the macro", "meeting subject 3", "meeting subject 4", "meeting subject 5") arrRmSize = Array("2", "3", "6", "4", "50") ' Go through the array and look for a match, then do something For i = LBound(arrSubject) To UBound(arrSubject) If InStr(Item.Subject, arrSubject(i)) Then RmSize = arrRmSize(i) strSubject = arrSubject(i) ' Start Registry method ' Replace with text code if desired Dim sAppName As String Dim sSection As String Dim sKey As String Dim lRegValue As Long Dim iDefault As Integer sAppName = "Outlook" sSection = "Meeting Counts" sKey = strSubject ' The default starting number. iDefault = 0 ' adjust as needed ' Get stored registry value, if any. lRegValue = GetSetting(sAppName, sSection, sKey, iDefault) ' If the result is 0, set to default value. If lRegValue = 0 Then lRegValue = iDefault ' Increment and update number. SaveSetting sAppName, sSection, sKey, lRegValue + 1 If lRegValue > RmSize Then ' End Registry code Set oRespond = Application.CreateItem(olMailItem) With oRespond .Recipients.Add Item.SenderEmailAddress .Subject = "Sorry: " & strSubject .Body = " Sorry, the room is full. You're on the waiting list. " & "You are " & lRegValue - RmSize & " on the waiting list." ' use .display for testing, .send after it is working as desired '.Display .Send End With Set oRespond = Nothing End If End If Next i End Sub