Hi
I am using the following VBA to save email attachments to specific folder and then record it in an excel file
----> what i need is to convert the attachments to a compressed file (winrar or winzip)
Public Sub SATD(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "D:\DOWNLOADTEST\"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.filename
'------------------------------------------------------------------
Dim filename As String
Dim RetVal
Dim fs
filename = "D:\DOWNLOADTEST\TEST.xlsm"
Set fs = CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(filename)) Then
Shell "cmd.exe /c Start ""Tiff"" """ & filename & """"
Else
MsgBox ("File not found")
End If
Next
End Sub
I am using the following VBA to save email attachments to specific folder and then record it in an excel file
----> what i need is to convert the attachments to a compressed file (winrar or winzip)
Public Sub SATD(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "D:\DOWNLOADTEST\"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.filename
'------------------------------------------------------------------
Dim filename As String
Dim RetVal
Dim fs
filename = "D:\DOWNLOADTEST\TEST.xlsm"
Set fs = CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(filename)) Then
Shell "cmd.exe /c Start ""Tiff"" """ & filename & """"
Else
MsgBox ("File not found")
End If
Next
End Sub