Debugging would have shown vText(i) was always only vText(0)
Option Explicit
Sub HallQuestion()
Dim olItem As Object
Dim vText As Variant
Dim sText As String
Dim vItem As Variant
Dim Hallsitem As String
Dim HRItem As String
Dim i As Long
If Application.ActiveExplorer.Selection.count = 0 Then
MsgBox "No Items selected!", vbCritical, "Error"
Exit Sub
End If
For Each olItem In Application.ActiveExplorer.Selection
If TypeOf olItem Is MailItem Then
sText = olItem.body
vText = Split(sText, Chr(13))
HRItem = "Yes"
Debug.Print UBound(vText)
For i = 0 To UBound(vText)
Debug.Print vText(i)
If InStr(1, vText(i), "Are you a resident in a halls of residence? :") > 0 Then
'If InStr(1, vText(i), "Are you a resident in a halls of residence?:") > 0 Then
vItem = Split(vText(i), Chr(58))
Hallsitem = Trim(vItem(1))
Exit For
End If
Next i
If Hallsitem = HRItem Then
MsgBox ("Worked")
Hallsitem = ""
Else
MsgBox ("Did not Work")
End If
End If
Next olItem
End Sub