Outlook rule from domain wildcard
![outlook rule from domain wildcard outlook rule from domain wildcard](https://www.slipstick.com/images/2011/07/rules1.jpg)
![outlook rule from domain wildcard outlook rule from domain wildcard](https://cdn.extendoffice.com/images/stories/doc-outlook/search-wildcard/doc-search-wildcard-2.png)
RegEx.Pattern = "(v\|agra|erection|penis|boner|pharmacy|painkiller|vicodin|valium|adderol|sex med|pills|pilules|viagra|cialis|levitra|rolex|diploma)" Sub MyNiftyFilter(Item As Outlook.MailItem)ĭim Action As Actions: Action = ACT_DELIVER ' quote so that the syntax highlighter will stop coloring everything as a string.'
#Outlook rule from domain wildcard code
' make the code appear correctly, each comment must be closed with another single ' comment character (the single quote) - it treats it as a string delimiter. For example: ' note that Stack Overflow's syntax highlighting doesn't understand VBScript's Note that a subroutine called by a rule must have a single parameter of type Outlook.MailItem. You can now create a subroutine to perform your filtering action. Next select Tools menu | References and enable the RegExp references called something like "Microsoft VBScript Regular Expressions 5.5" Double-click ThisOutlookSession to open the code editing pane (which will probably be blank). Expand that to reveal ThisOutlookSession. Expand this item to reveal Microsoft Office Outlook Objects. The project will be listed as VBAProject.OTM. It should contain a project outline in a small panel in the top-left corner. I hate Outlook.įirst, you have to open the script editor via Tools - Macro - Open Visual Basic Editor (Alt-F11 is the shortcut). I do not know if a regex can be used directly in a rule, but you can have a rule trigger a script and the script can use regexes. If Not (MatchesSubject Is Nothing And MatchesBody Is Nothing) Then Set MatchesBody = RegEx.Execute(Message.Body) Set MatchesSubject = RegEx.Execute(Message.Subject) If (RegEx.Test(Message.Subject) Or RegEx.Test(Message.Body)) Then I thought I would share my code below in case it is able to help anyone else: Sub JobNumberFilter(Message As Outlook.MailItem)
![outlook rule from domain wildcard outlook rule from domain wildcard](https://www.sperrysoftware.com/Email-Tools/wp-content/uploads/2019/03/New-Customer-Order-WooCommerce-Rule.png)
I wasn't able to find anything concrete online about whether Outlook even supports entering regexes into a rule, though, so I figured I would ask here in case I'm wasting my time.ĮDIT: Thanks to Chris's comment below, I was able to implement this filter via a macro. I've tried a few other modifications as well with no luck.
![outlook rule from domain wildcard outlook rule from domain wildcard](https://us.v-cdn.net/6029482/uploads/editor/fv/v4yjg98rloil.jpg)
I was using this as a regex: \b\b but the filter isn't working. I'm trying to add a filter for messages containing a string such as: 4000-10, a four digit number followed by a dash and then a two digit number, which can be anything from 0000-00 to 9999-99. And now all emails containing the partial of keyword are found out and listed at the bottom of Advanced Find dialog box.Is it possible to create rules in Outlook 2007 based on a regex string? (3) Type the partial of keyword you will search into the Value box Īnd now the customized search criteria is added into the Find items that match these criteria box.Ĥ. (2) Select the contains from the Condition drop down list (1) Click Field > All Mail fields > Subject, Message, or other fields as you need In the opening Advanced Find dialog box, please go to the Advanced tab, and: Note: You can also open the Advanced Find dialog box by putting cursor in the Instant Search box and clicking Search > Search Tools > Advanced Find.ģ. Press Ctrl + Shift + F keys at the same time to open the Advanced Find dialog box. Shift to the Mail view, and open the mail folder where you will search with wildcard.Ģ. However, we can configure the advanced find option, and search emails containing the specified partial of keywords in Outlook.ġ. Actually, there is no directly workaround to search partial word with wildcard in all emails of a mail folder in Outlook.