Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automated Email Messages from Excel w/VBA
Hi - the routine below sends an email message on behalf of
outlook from MS Excel. Every time it tries to send an email a message in outlook pops up saying that another application is trying to send an email on outlook's behalf, would i like to allow this? Does anyone know if there is a way to avoid having outlook display this message and just send the email? My routine is displayed below my signature. Thanks! -Aaron Sub SendEmails() '\\DECLARATIONS\\ Dim mlNewMessage As MailItem Dim myOlApp Dim strBody As String '\\-BUILD EMAIL BODY-\\ strBody = "This is the Email Body" '\\E-MAIL GENERATION BUILD BEGINS HERE\\ Do Until Range("A1").Offset(a, 0) = "STOP" Set myOlApp = CreateObject ("Outlook.Application") 'Create New Outlook Item Set mlNewMessage = myOlApp.CreateItem (olMailItem) 'Create New Mail Item mlNewMessage.Body = strDear & strBody & strConfidentiality 'Defines Email Body mlNewMessage.Subject = "Message Subject" 'Defines "Subject" mlNewMessage.To = Range("A1").Offset(a, 1) 'Defines "To" mlNewMessage.Send 'Sends Email Message Set myOlApp = Nothing 'Clears mlOlApp Variable Set mlNewMessage = Nothing 'Clears mlOlApp Variable a = a + 1 Loop End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Export messages to Excel | Excel Discussion (Misc queries) | |||
how do i send an automated email from excel using an if statement | Excel Worksheet Functions | |||
Excel'03 - non printing help/hint automated messages | Excel Discussion (Misc queries) | |||
can an automated notification (on xls file changes) email can be | Excel Discussion (Misc queries) | |||
Excel messages for Blackberry | Excel Discussion (Misc queries) |