Outlookscript with event

  • Thread starter Thread starter robert
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
Back
Top