Outlookscript with event

R

robert

Hi there

Is it possible to make a rule that checks for new emails with a
specified subject i a mailbox
and if it match the rule then launch a script that create a event i the
local eventlog

thanks
 
S

Sue Mosher [MVP-Outlook]

A "run a script" rule action actually uses not an external script but a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:

Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
' do stuff with olMail, e.g.
MsgBox olMail.SUbject

Set olMail = Nothing
Set olNS = Nothing
End Sub

See http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example.


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

robert

HI sue
It works great But is there anyway tha i can change it for a client
side rule to a server side rule
Im running exchange 2003

THX Robert
 
R

robert

some days i can't write either

OK the script works fine But is there anyway that i can change it from
being a client
side rule to a server side rule
I'm running exchange 2003

Thank SUE your the ONE
 
S

Sue Mosher [MVP-Outlook]

No, if you want custom code to run on the server, you're talking about an Exchange event sink, not an Outlook rule.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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