For i = 1 To 3
With Reg1
Select Case i
Case 1
.Pattern = "File Date:\s((.*))\n"
.Global = False
Case 2
.Pattern = "File Size:\s(([\d]*))\n"
.Global = False
Case 3
.Pattern = "Records:\s(([\d]*))\n"
.Global = False
End Select
End With
If Reg1.test(olMail.Body) Then
Set M1 = Reg1.Execute(olMail.Body)
For Each M In M1
Debug.Print M.SubMatches(1)
strSubject = M.SubMatches(1)
if i = 1 then vText = strSubject
if i = 2 then vText2 = strSubject
if i = 3 then vText3 = strSubject
Next
End If
Next i