how to disable outlook security messages

  • Thread starter Thread starter swap
  • Start date Start date
S

swap

I have created script for auto reply in outlook and created rule to execute
it but whenever this rule runs it give following popup

" A program is trying to access e-mail addresses you have stored in Outlook.
Do you want to allow this"
And I have to click on yes.
I want to prevent this popup so that it will automatically reply mails
according to rule
How can I disable this popup?
 
You need to structure the "run a script" procedure so that it derives the
MailItem from the intrinsic Application object, like this example:

Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rply as Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
Set rply = msg.Reply
rply.Body = "What you want the reply to say."
rply.To = "(e-mail address removed); (e-mail address removed)"
rply.Send

Set msg = Nothing
Set rply = Nothing
Set olNS = Nothing
End Sub


CAUTION: Using this technique has been known to result in corrupt VBA code.
Be sure to export your code modules or back up the VBAProject.otm file.
 
Back
Top