For i = 1 To MacroBook.Worksheets("Macro").Range("A1").Value
Set myitem = myFolder.Items(i)
Set olProperty = myitem.UserProperties.Add("KeyWord", olText)
msgtext = myitem.Body
Application.StatusBar = "Rule 1 " & myFolder.Items(i).Subject & " " & i
If olProperty.Value = "" Then
If (InStr(1, myFolder.Items(i).Body, KWrd1, vbTextCompare) > 0) Then
If VBA.DateValue(VBA.Now) - VBA.DateValue(myFolder.Items(i).ReceivedTime) = 0 Then
ExportSht.Columns("A:BA").Clear
ExportSht.Range("A1").Value = myFolder.Items(i).Body
MacroBook.Activate
ExportSht.Select
EmailTime = myFolder.Items(i).ReceivedTime
EmailAddress = myFolder.Items(i).SenderEmailAddress
EmailSubject = myFolder.Items(i).Subject
EmailCategory = myFolder.Items(i).Categories
Call Export_Email
Call Prepare_Template
End If
End If
End If
Next