If you want to email all files in a folder, to an email address
(in this case it will be the address in cell A2)
then this will work
Code:Sub Mail_small_Text_Outlook() 'Working in Office 2000-2010 Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim StrFile As String Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) strbody = "Hi there" & vbNewLine & vbNewLine & _ "See attached" & vbNewLine On Error Resume Next With OutMail .To = Range("a2").Value 'Email Address (can be a cell reference) .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = strbody StrFile = Dir("C:\*") 'location of files to send Do While Len(StrFile) > 0 .Attachments.Add ("C:\" & StrFile) 'insert your file path here too no Asterisk * StrFile = Dir Loop .Display 'or use .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub
if you want to open the mails and send them i dont think i will be able to help




Reply With Quote
Bookmarks