Archive only 'Read e-mails'
Sorry that should be
Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemChange(ByVal Item As Object)
If (Item.Class = olMail) And (Item.UnRead = False) Then
On Error Resume Next
' Msgbox "Setting do not archive flag now"
Item.NoAging = True
On Error Goto 0
End if
End Sub
On Jan 11, 4:41*pm, JP wrote:
You may want to post your question in microsoft.*public.*outlook.*
program_vba.
|