-
Figured out it doesn't like "AT" signs. 
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Dim myExt As String
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
i = 0
For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
myExt = Mid(Atmt.FileName, InStrRev(Atmt.FileName, Chr(46)))
Select Case myExt
Case ".pdf"
FileName = "\\AP Invoices for Processing" & _
Format(Item.CreationTime, "yyyymmdd_hhmmss_") & Atmt.FileName
Atmt.SaveAsFile FileName
i = i + 1
Case Else
End Select
Next Atmt
Next Item
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules