Articles → VBA FOR OUTLOOK → Call a VB script in a rule in outlook

Call a VB script in a rule in outlook






Prerequisite












Picture showing registry window for setting the value of EnableUnsafeClientMailRules from 0 to 1

Click to Enlarge




Create a VBA script








Picture showing the Visual Studio button inside the developer tab

Click to Enlarge



Picture showing the visual basic editor for writing code

Click to Enlarge





Sub MyMethod(Item As Outlook.MailItem)
	MsgBox "Hi"
End Sub




Picture showing the implementation of MyMethod inside the visual basic editor

Click to Enlarge


Create rule








Picture showing the Rules menu for creating new rules

Click to Enlarge



Picture showing the Create Rule window for setting the rule on subject line

Click to Enlarge





Picture showing the Rules wizard when rule is created on the subject line

Click to Enlarge





Picture showing the action to be performed when rule criteria is met

Click to Enlarge





Picture showing the list of script to be choosen for execution

Click to Enlarge




Output




Picture showing the message box which invoked when the rule criteria is met

Click to Enlarge

Posted By  -  Karan Gupta
 
Posted On  -  Sunday, October 21, 2018

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250