MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Sub SaveOutlookAttachments(olkMessage As Outlook.MailItem) Dim olkAttachment As Outlook.Attachment, _ objFSO As Object, _ strRootFolderPath As String, _ strFilename As String 'Path for where to save attachments strRootFolderPath = "X:\sh_fox\FIR_TBT\2011\2011_ExceptionReports\2011_March\3-7-2011\" Set objFSO = CreateObject("Scripting.FileSystemObject") Set olkSourceFolder = Application.ActiveExplorer.CurrentFolder If olkMessage.Attachments.Count > 0 Then For Each olkAttachment In olkMessage.Attachments strFilename = olkAttachment.FileName intCount = 0 Do While True If objFSO.FileExists(strRootFolderPath & strFilename) Then intCount = intCount + 1 strFilename = "Copy (" & intCount & ") of " & olkAttachment.FileName Else Exit Do End If Loop olkAttachment.SaveAsFile strRootFolderPath & strFilename Next End If Set objFSO = Nothing Set olkAttachment = Nothing Set olkMessage = Nothing End Sub
|Find and Replace Function not working in Excel||13||41|
|How to display data labels along bottom of a line chart||3||15|
|how to import result to CVS from sql server management studio without comma||2||12|
|Request to review costing formula||3||31|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!