Outlook 2K3 Rules and Run A Script

G

Guest

Is there something special you have to do to enable "Run A Script" in Rules
in Outlook 2003?

I'm runing XPSP2 and I've added a rule to process every incoming message and
run a script and show an alert. The alert shows up but the macro does not
get executed. The macro is as follows:

Sub IncomingMessage(Item As Outlook.MailItem)
MsgBox "ding"
End Sub

I've tried changing my security settings to prompt for active scriptiong, as
well as placing the macro ThisOutlookSession.

Any ideas?

Thanks -- Peter
 
S

Sue Mosher [MVP-Outlook]

Did you check your macro security settings in Tools | Macro | Security and
restart Outlook after making any changes?
 
G

Guest

Thanks Sue,

That was indeed the part I missed. I should have remember that from my
Excel work...

Thanks -- Peter
 
G

Guest

hi Ritchie/Sue... I have the same problem... I have change my security to:
Low and unchecked the Trusted option. Still I cannot see the macro that I
have defined in my ThisOutlookSession section.

any idea about this? Regards! JC
 
S

Sue Mosher [MVP-Outlook]

Did you construct the procedure that you want to use as a script properly?
It must be a Public procedure with a single argument -- a MailItem or
MeetingItem.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Hi Sue/anyone... I have this script to send an email to another account, but
the below code shows me a Securti alert:
Sub sendmsg(EmailMsg As MailItem)

Set msgx = Application.CreateItem(olMailItem)
msgx.To = "(e-mail address removed)"

cust = EmailMsg.Reply

' this statement shows the Security Alert!
val2 = EmailMsg.Recipients.Item(1)

msgx.Body = "programa..." & cust & val2

msgx.Send

End Sub

could you help to not show that alert...
regards! JC
***********
 
G

Guest

hi all... hope you can help..
1. how can I use/Install Redemption ? ..
I'm getting this msg: User-defined type not defined

thanks! JC
 
S

Sue Mosher [MVP-Outlook]

You'd can use Redemption to work around that (See
http://www.dimastr.com/redemption for information on Redemption.)

Sub sendmsg(EmailMsg As MailItem)

Set rMsgIn = CreateObject("Redemption.SafeMailItem")
Set rMsgOut = CreateObject("Redemption.SafeMailItem")

Set msgx = Application.CreateItem(olMailItem)
msgx.To = "(e-mail address removed)"

rMsgIn.Item = EmailMsg
val2 = rMsgIn.Recipients.Item(1).Name

msgx.Body = "programa..." & val2
rMsgOut.Item = msgx
rMsgOut.Send

End Sub


I could not tell what this statement in your original code was supposed to
do:

cust = EmailMsg.Reply

You would need to use Set to get the reply message:

Set cust = EmailMsg.Reply

But I can't figure out what you do with cust later, so I omitted it.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

thanks Sue, but the below code still is not working for me...
why is that the TO property is linked to "msgx" variable
and the Send cmd is linked to "rMsgOut" ? ..
any changes I should do ?
 
S

Sue Mosher [MVP-Outlook]

any changes I should do ?

Yes, you'll need to download and install Redemption from
http://www.dimastr.com/redemption/. I'm sorry I forgot to direct you there
earlier.
thanks Sue, but the below code still is not working for me...

After you install Redemption, set a breakpoint and step through the code in
the debugger and tell us in particular is not working.
why is that the TO property is linked to "msgx" variable

Because that's what you had in your original code:

msgx.To = "(e-mail address removed)"
and the Send cmd is linked to "rMsgOut" ? ..

Because you need to use a Redemption SafeMailItem to be able to execute the
Send method without triggering a security prompt.
 
G

Guest

1. is there any other option to installing Redemrption? ... I'm not sure I
can do that at my place...
2. is there something at the MS Office site?
regards! JC
 

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