Distributing Outlook XP rules

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Hi

I'm wondering if there is any way to distribute Outlook XP rules? If you
have 170 Outlook users and want a global rule is there any easy way to set
it up?

Thanks..
Adam.
 
yes, there is.
you can script rules creation. only thing is, that you can not see the
script-created rules
in the rules wizard. for my belongings this was ok, so now my users receive
spam-rules via vbs.

see microsoft rules component reference for details. (rule.dll)

it will look like this: (dont use it, it will not work, because i cut and
pasted the interesting parts.)

Const ACTION_MOVE = 1
Const SUBSTRING = 1 ' Substring
Const IGNORECASE = &H00010000 ' Ignore case
Const CdoPR_SUBJECT = &H0037001E
Const CdoPR_TRANSPORT_MESSAGE_HEADERS = &H007D001E
....
....
' Create session object and logon to machine SERVER as TestUser
Set objSession = CreateObject("MAPI.Session")
objSession.Logon "","",False,True,True,True,"SERVER" & vbLF & "TestUser"
Set objRules = CreateObject("MSExchange.Rules")
objRules.Folder = objSession.Inbox
Set objRule = CreateObject("MSExchange.Rule")
....
' Create action
Set objAction = CreateObject("MSExchange.Action")
objAction.ActionType = ACTION_MOVE
objAction.Arg = ActionFolder
....
' Create PropertyValue with "*"(string) in the Subject
Set objPropVal = CreateObject("MSExchange.PropertyValue")
'objPropVal.Tag = CdoPR_SUBJECT
objPropVal.Tag = CdoPR_TRANSPORT_MESSAGE_HEADERS
objPropVal.Value = strHeader
...
' Create ContentCondition
Set objContCond = CreateObject("MSExchange.ContentCondition")
'objContCond.PropertyType = CdoPR_SUBJECT
objContCond.PropertyType = CdoPR_TRANSPORT_MESSAGE_HEADERS
objContCond.Operator = SUBSTRING + IGNORECASE
objContCond.Value = objPropVal
...
' Create Rules object and add new Rule to Inbox rules
objRule.Name = "SPAM"
objRule.Condition = objContCond
objRule.Actions.Add ,objAction
...
' Create Rules object and add new Rule to Inbox rules
objRules.Add , objRule
...
' Update the rules
objRules.Update
....
objSession.Logoff
 
Also, rules created with the Rule.dll component are limited in
capabilities -- they can't do everything a Rules Wizard rule can do.

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