Merry Xmas?
Private Sub Application_NewMail()
Dim newMsg As Integer
Set myOlApp = CreateObject("Outlook.Application"

Set myNamespace = myOlApp.GetNamespace("MAPI"

Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
c = myFolder.Items.Count
For newMsg = c To 1 Step -1
Set myitem = myFolder.Items(c)
Set myAttachments = myitem.Attachments
If myitem.UnRead = False Then Exit For
If myAttachments.Count > 0 Then
myitem.Display
Set myitem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myitem.Attachments
myAttachments.Item(1).SaveAsFile "C:\Outlook Attachments\" & myAttachments.Item(1).DisplayName
myitem.Close olDiscard
Else
Exit Sub
End If
Next newMsg
End Sub
Tranpkp ![[pc2] [pc2] [pc2]](/data/assets/smilies/pc2.gif)