jfgambit
Kinetic Card Dealer
- Local time
- Today, 09:23
- Joined
- Jul 18, 2002
- Messages
- 798
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:
Thanks for any help, been wracking my head searching every site I know of.
I was trying to use this, but it completely ignores this part of the code:
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
With SafeMail
.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 _
& vbNewLine
End With
'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
Loop
With SafeMail
.Importance = Outlook.olImportance.olImportanceHigh
.Send
End With
Set Utils = CreateObject("Redemption.MAPIUtils")
Utils.DeliverNow
Set myOlApp = Nothing
Set SafeMail = Nothing
Set Utils = Nothing
Thanks for any help, been wracking my head searching every site I know of.