I've got given the crazy task of writing a custom rule for Outlook that affects emails that does not have an attachment . Currently in the rules wizard there is an option that targets emails that does have an attachment but not the other way round, strange...
Also worth saying here that I've never written a line of Visual Basic ever! But it's just a little rule, how difficult can it be.
This is what I have currently:
Dim WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
' If the mail doesn't contain an attachment
If Item.Attachments.Count = 0 Then
' Chirp chirp..
End If
End Sub
An empty if statement.. But basically all I have to do now is call some "delete" function on the "Item" object. Which would then delete the email if it doesn't have an attachment, easy.. I'm used to writing Java and C#, just fyi
Any pointers out there?