how to disable outlook security messages

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?
 
S

Sue Mosher [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top