Send Access reports in email with Security Warning

PS.

This is the above code set for multi attachments and as you can see it is allowing for file names that would not be on the list.

Dim OutMail As Object
Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)


With OutMail
.To = [Forms]![PrintAndClose]![EMStore]

.Subject = "Test Email"
.Attachments.Add ("C:\ViperResides\ReportColumnExp.pdf")

On Error Resume Next

.Attachments.Add ("C:\Letters\0ComparisonMikeDoesNotExist.doc")

On Error Resume Next

.Attachments.Add ("C:\Letters\0Letter1Mike.doc")

On Error Resume Next

.Attachments.Add ("C:\Letters\0Letter3MikeDoesNotExist.doc")

On Error Resume Next

.Attachments.Add ("C:\Letters\0Letter3Mike.doc")

On Error Resume Next

.Attachments.Add ("C:\Letters\TowerPDS.pdf")

.Body = [Forms]![PrintAndClose]![EMMessage]
.Send
End With
 

Users who are viewing this thread

Back
Top Bottom