<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> createOutlookRule()<br><SPAN style="color:#00007F">Dim</SPAN> appOutlook <SPAN style="color:#00007F">As</SPAN> Outlook.Application<br><SPAN style="color:#00007F">Dim</SPAN> olRules <SPAN style="color:#00007F">As</SPAN> Outlook.Rules<br><SPAN style="color:#00007F">Dim</SPAN> myRule <SPAN style="color:#00007F">As</SPAN> Outlook.Rule<br><SPAN style="color:#00007F">Dim</SPAN> moveToAction <SPAN style="color:#00007F">As</SPAN> Outlook.MoveOrCopyRuleAction<br><SPAN style="color:#00007F">Dim</SPAN> fromAction <SPAN style="color:#00007F">As</SPAN> Outlook.ToOrFromRuleCondition<br><SPAN style="color:#00007F">Dim</SPAN> myInbox <SPAN style="color:#00007F">As</SPAN> Outlook.Folder<br><SPAN style="color:#00007F">Dim</SPAN> moveToFolder <SPAN style="color:#00007F">As</SPAN> Outlook.Folder<br><br><SPAN style="color:#00007F">Set</SPAN> appOutlook = <SPAN style="color:#00007F">New</SPAN> Outlook.Application<br><SPAN style="color:#00007F">Set</SPAN> myInbox = appOutlook.Session.GetDefaultFolder(olFolderInbox)<br><SPAN style="color:#00007F">Set</SPAN> moveToFolder = myInbox.Folders("MyWorkFlow")<br><SPAN style="color:#00007F">Set</SPAN> olRules = appOutlook.Session.DefaultStore.GetRules()<br><SPAN style="color:#00007F">Set</SPAN> myRule = olRules.Create("My Test Rule", olRuleReceive)<br><SPAN style="color:#00007F">Set</SPAN> fromAction = myRule.Conditions.From<br><br><SPAN style="color:#007F00">' With the "from" action</SPAN><br><SPAN style="color:#00007F">With</SPAN> fromAction<br><SPAN style="color:#007F00">' Enable the condition</SPAN><br><br>.Enabled = <SPAN style="color:#00007F">True</SPAN><br><br><SPAN style="color:#007F00">' Add the e-mail sender</SPAN><br><SPAN style="color:#007F00">' Here, I use the user-friendly name in my address book</SPAN><br>.Recipients.Add ("Robert Martim")<br><br><SPAN style="color:#007F00">' Resolve the recipients so that we know they're valid</SPAN><br>.Recipients.ResolveAll<br><SPAN style="color:#00007F">End</SPAN> With<br><br><SPAN style="color:#007F00">' Determine the action type (moveToFolder, in this case)</SPAN><br><SPAN style="color:#00007F">Set</SPAN> moveToAction = myRule.Actions.moveToFolder<br><br><SPAN style="color:#007F00">' <SPAN style="color:#00007F">With</SPAN> the moveToAction</SPAN><br>With moveToAction<br><SPAN style="color:#007F00">' Enable the action</SPAN><br>.Enabled = <SPAN style="color:#00007F">True</SPAN><br><br><SPAN style="color:#007F00">' Determines the destination folder</SPAN><br>.Folder = moveToFolder<br><SPAN style="color:#00007F">End</SPAN> With<br><br><SPAN style="color:#007F00">' Save the rule in Outlook's Rules list</SPAN><br>olRules.Save<br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><br></FONT>