A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , , ,

How do you Disable Outlook Warning in Automated Email?





 
 
Thread Tools Display Modes
  #1  
Old January 12th 07, 11:23 PM posted to microsoft.public.outlook.program_vba
Need lots of help!
external usenet poster
 
Posts: 1
Default How do you Disable Outlook Warning in Automated Email?


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  
Old January 13th 07, 08:36 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,264
Default How do you Disable Outlook Warning in Automated Email?



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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Advertising - Hen Night - Loans - Credit Cards - Bad Credit Mortgages