![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: automated, disable, email, outlook, warning |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have an excel macro setup to send email automatically from a list that does not activate the Outlook Warning (Send_Msg). However, I tried to add a reply recipient (AddReplyRecip)to the email, and now the outlook warning pops up asking if I want to allow another program to access my outlook AddReplyRecip. Is there a way to program around this? Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Dim strRecipName As String Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) strRecipName = "ALLTEL CALL CENTER BUSINESS IMPROVEMENT" myBody = Range("C20") For Each cell In Sheets("Email List").Columns("B").Cells.SpecialCells(xlCellTypeC onstants) If cell.Value Like "?*@?*.?*" And LCase(cell.Offset(0, 1).Value) = "yes" Then With objMail .To = cell.Value .Subject = "OPT OUT " & myBody .Body = "This is a request to OPT OUT " & _ "all subscriptions to MDN: " & myBody & Chr(13) & Chr(13) & "ALLTEL" .Display End With If objMail.Class = olMail And _ objMail.Sent = False Then Call AddReplyRecip(objMail, strRecipName) End If Set OutMail = Nothing End If Next cell Set objOL = Nothing End Sub Private Sub AddReplyRecip(objMsg As MailItem, strName As String) Dim colReplyRecips As Recipients Dim objReplyRecip As Recipient Dim strPrompt As String Dim intRes As Integer On Error Resume Next objMsg.ReplyRecipients.Add (strName) If Err = 287 Then strMsg = "This message was sent from your profile." & _ " You must select Yes to ensure return mail" & _ " goes to the Short Code Support Team." res = MsgBox(strMsg, vOk + vbDefaultButton1, _ "Security Prompt Cancelled") If res = vbOK Then Cancel = False Else objReplyRecip.Delete End If Err.Clear End If Set colReplyRecips = Nothing Set objReplyRecip = Nothing End Sub |
| Ads |
|
#2
|
|||
|
|||
|
Please read http://www.outlookcode.com/d/sec.htm -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Keep your Outlook categories organized! http://www.shareit.com/product.html?...4&languageid=1 (German: http://www.VBOffice.net/product.html?pub=6) Am Fri, 12 Jan 2007 14:23:01 -0800 schrieb Need lots of help!: I have an excel macro setup to send email automatically from a list that does not activate the Outlook Warning (Send_Msg). However, I tried to add a reply recipient (AddReplyRecip)to the email, and now the outlook warning pops up asking if I want to allow another program to access my outlook AddReplyRecip. Is there a way to program around this? Sub Send_Msg() Dim objOL As New Outlook.Application Dim objMail As MailItem Dim strRecipName As String Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) strRecipName = "ALLTEL CALL CENTER BUSINESS IMPROVEMENT" myBody = Range("C20") For Each cell In Sheets("Email List").Columns("B").Cells.SpecialCells(xlCellTypeC onstants) If cell.Value Like "?*@?*.?*" And LCase(cell.Offset(0, 1).Value) = "yes" Then With objMail .To = cell.Value .Subject = "OPT OUT " & myBody .Body = "This is a request to OPT OUT " & _ "all subscriptions to MDN: " & myBody & Chr(13) & Chr(13) & "ALLTEL" .Display End With If objMail.Class = olMail And _ objMail.Sent = False Then Call AddReplyRecip(objMail, strRecipName) End If Set OutMail = Nothing End If Next cell Set objOL = Nothing End Sub Private Sub AddReplyRecip(objMsg As MailItem, strName As String) Dim colReplyRecips As Recipients Dim objReplyRecip As Recipient Dim strPrompt As String Dim intRes As Integer On Error Resume Next objMsg.ReplyRecipients.Add (strName) If Err = 287 Then strMsg = "This message was sent from your profile." & _ " You must select Yes to ensure return mail" & _ " goes to the Short Code Support Team." res = MsgBox(strMsg, vOk + vbDefaultButton1, _ "Security Prompt Cancelled") If res = vbOK Then Cancel = False Else objReplyRecip.Delete End If Err.Clear End If Set colReplyRecips = Nothing Set objReplyRecip = Nothing End Sub |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automated Email in a Custom Contact Form | Michelle W@ | Outlook - Using Forms | 0 | October 11th 06 05:56 PM |
| Outlook 2007: Disable Security Certificate Warning | Chase | Outlook - General Queries | 8 | June 7th 06 09:56 AM |
| How to disable security warning? | Richard Lewis Haggard | Outlook - General Queries | 2 | April 4th 06 05:07 PM |
| using mapisend for an automated email, want to diasable popup | Raj | Outlook - Installation | 1 | March 3rd 06 07:23 PM |
| Add a meeting-ending tone, like a warning. Like warning before. | Nicholas NFB | Outlook - Calandaring | 2 | January 21st 06 10:28 PM |