I was wondering if anyone had code examples for emailing the contents of an entire folder? The folder can have multiple file types in it (excel, pdf, word, etc) but every file need to be linked to the Outlook e-mail that Access produces.
I was trying to use this, but it completely ignores this part of the code:
Dim str_Source_Path As String
Dim str_File_Name As String
str_Source_Path = "C:\Temp"
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(0)
Set SafeMail = CreateObject("Redemption.SafeMailItem")
Set SafeMail.Item = myItem
.Recipients.Add (Me.CSOA) ' Send To
.Recipients.Add (strSendTo) ' test code
.Subject = "A new Peer/Management Validation has been completed for SO #" & Me.SONbr & " by " & Me.Validator & " for " & Me.CSOA
.Body = "Validation Request - SO #" & Me.SONbr & vbNewLine _
& "Customer Name: " & Me.CustNm & vbNewLine _
& vbNewLine _
& vbNewLine _
& "Order Validation Completed: " & Me.CreateDt & vbNewLine _
& "Total Time Taken to Validate: " & strTimeDiff & vbNewLine _
& "http://sp-fin/sites/OMApp/AuditValidation/Forms/AllItems.aspx" & vbNewLine _
'Loop and attach all files from this folder
str_File_Name = Dir(str_Source_Path)
Do While str_File_Name <> ""
SafeMail.Attachments.Add (str_Source_Path & str_File_Name)
str_File_Name = Dir
.Importance = Outlook.olImportance.olImportanceHigh
Set Utils = CreateObject("Redemption.MAPIUtils")
Set myOlApp = Nothing
Set SafeMail = Nothing
Set Utils = Nothing
Thanks for any help, been wracking my head searching every site I know of.