Home |
Search |
Today's Posts |
#1
|
|||
|
|||
VBA to IMAP folder
Does anyone know how would you modify the following macro to go to your IMAP folder to be sent instead of your Outbox? My IMAP account has no outbox and it winds up in an email account that has not even been set up. Sub Outlook_Mail_Every_Worksheet() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim strdate As String Dim wb As Workbook Dim ws As Worksheet Application.ScreenUpdating = False Set OutApp = CreateObject("Outlook.Application") For Each ws In ThisWorkbook.Worksheets If ws.Range("a1").Value Like "?*@?*.?*" Then strdate = Format(Now, "dd-mm-yy h-mm-ss") ws.Copy Set wb = ActiveWorkbook With wb .SaveAs "Sheet " & ws.Name & " of " _ & ThisWorkbook.Name & " " & strdate & ".xls" Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = ws.Range("a1").Value .CC = "" .BCC = "" .Subject = "Month End Summary Report" .body = "Hi" & vbNewLine & vbNewLine & _ "Please find the attached month end summary." & vbNewLine & _ " " & vbNewLine & _ "Phone: 555-5555 or Email " & vbNewLine & _ "Cheers" .Attachments.Add wb.FullName .Send End With .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With Set OutMail = Nothing End If Next ws Set OutApp = Nothing Application.ScreenUpdating = True End Sub -- billy2willy ------------------------------------------------------------------------ billy2willy's Profile: http://www.excelforum.com/member.php...o&userid=21648 View this thread: http://www.excelforum.com/showthread...hreadid=396286 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file folder macro's | Links and Linking in Excel | |||
"Save As" folder -- can I default this to the same folder as origi | Excel Discussion (Misc queries) | |||
Deafult Data Source Folder | Excel Discussion (Misc queries) | |||
What is folder OLK7 and where can I find it? | Excel Discussion (Misc queries) | |||
How can I change the appearance of the folder icon | Excel Discussion (Misc queries) |