Is the With Events line at the top of the ThisOutlookSession module (before the macros, but after Option Explicit if present)?
e.g.
as for the attachments you will need to loop through the attachments collection e.g.Option Explicit Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim olApp As Outlook.Application 'etc
For i = 1 To olItem.Attachments.Count If InStr(1, olItem.Attachments(i).fileName, "[CAT1]", vbTextCompare) > 0 Then olItem.Categories = "CAT1" olItem.Save Exit For End If Next i




Reply With Quote