I currently have code to save an attachment if it is an excel file to a certain folder. I am trying to find a way to add the option to save only if the attachment is over a certain size. what can I use to check the incoming attachment size?
I currently have code to save an attachment if it is an excel file to a certain folder. I am trying to find a way to add the option to save only if the attachment is over a certain size. what can I use to check the incoming attachment size?
There is a Size property for attachments.
https://msdn.microsoft.com/EN-US/lib.../ff866906.aspx
Option Explicit Sub attSize() Dim currItem As Object Dim oAtt As attachment Set currItem = ActiveInspector.currentItem Debug.Print vbCr & currItem.Subject For Each oAtt In currItem.Attachments Debug.Print " Display Name: " & oAtt.DisplayName & vbCr & " Size: " & oAtt.Size Next oAtt End Sub
To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx
If your problem has been solved in your thread, mark the thread "Solved" by going to the "Thread Tools" dropdown at the top of the thread. You might also consider rating the thread by going to the "Rate Thread" dropdown.
Thank you. I figured there was but couldn't get it right.