Shazam
11-04-2005, 07:18 AM
Hi everyone,
Well I have this code here to send out a attachments daily, My problem is I would like to send out multiple attachments that is last modified files in the folders. Does anyone has a code for that ?
Sub Send()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.To = ("Sand") ' Name of distribution list in Contacts 'Add Somebody on Fridays
If Weekday(Date) = 6 Then objmail.Recipients.Add ("anyone@home.com") 'Name of somebody@hotmail.com Contact
.Subject = "Sand Lab Data"
.Body = ""
.NoAging = True
.Attachments.Add "S:\Sand\"
.Attachments.Add "C:\Test\"
.Attachments.Add "Z:\Metal\"
.Display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub
Well I have this code here to send out a attachments daily, My problem is I would like to send out multiple attachments that is last modified files in the folders. Does anyone has a code for that ?
Sub Send()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.To = ("Sand") ' Name of distribution list in Contacts 'Add Somebody on Fridays
If Weekday(Date) = 6 Then objmail.Recipients.Add ("anyone@home.com") 'Name of somebody@hotmail.com Contact
.Subject = "Sand Lab Data"
.Body = ""
.NoAging = True
.Attachments.Add "S:\Sand\"
.Attachments.Add "C:\Test\"
.Attachments.Add "Z:\Metal\"
.Display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub