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 Removed);
(E-Mail 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.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"swap" <(E-Mail Removed)> wrote in message
news:2D217109-7136-41B6-8633-(E-Mail Removed)...
>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?
>
>