This sample works only with the microsoft frameworks 4.5 and above.
AddReference "F:\Progetti\Inventor\Progetti_2015\Compressione\dll\InvMyZip.dll" ' change the path with the correct dll location
Sub Main
cFolder = "f:\TestZip" ' the folder to compress
oZip = "f:\TestZip.zip" ' compressed file location and name
Dim CompressFolder As New InvMyZip.InvMyZip
CompressFolder.oZip(cFolder, oZip)
If System.IO.File.Exists(oZip) Then
SendMail("spam@dshortway.com", "SendMail Ilogic Rule Test Message", oZip, _
"Test message from Ilogic rule SendMail" & vbCr _
& "With multiline text in the body message!")
End If
CompressFolder = Nothing
End Sub
Private Sub SendMail(ToAdress as String, tSubject As String, aFile As String, tBody As String)
Dim OlApp As Object = CreateObject("Outlook.Application")
Dim eMail As Object = OlApp.CreateItem(0)
With eMail
.To = ToAdress
.Subject = tSubject
.attachments.Add(aFile)
.Body = tBody
.Display
'.Mail.Send ' uncomment this line if you want send your message immediately
End With
OlApp = Nothing
eMail = Nothing
End Sub
This sample and the attached files have to be considered "as is".
Bregs
Rossano Praderi
--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------