Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rob
 
Posts: n/a
Default VBA modification for IMAP email accont

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
View Public Profile
Send a private message to billy2willy
Find all posts by billy2willy
Add billy2willy to Your Buddy List



  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Rob

Never work with IMAP but maybe you can use
http://www.rondebruin.nl/cdo.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rob" wrote in message ...
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
View Public Profile
Send a private message to billy2willy
Find all posts by billy2willy
Add billy2willy to Your Buddy List





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Macro with Outlook Express Moe Excel Discussion (Misc queries) 2 August 10th 05 02:50 PM
Move a Column of 500 Email Addresses into BCC Field of an Email Mark Excel Worksheet Functions 9 July 27th 05 05:07 AM
Email hyperlink changes not showing in excel Nancy Excel Worksheet Functions 0 May 13th 05 12:26 AM
body of email disappears when I send an email from Excel ~A Excel Discussion (Misc queries) 0 February 25th 05 10:55 PM
background color showing only when in email form David Excel Discussion (Misc queries) 1 January 23rd 05 09:46 PM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"