none
Automatically creating rules when creating a task RRS feed

  • Question

  • I'm trying to get the following to work:

    When creating a new task the form would have a checkbox labeled "create rules?"

    If the checkbox is checked, there would be a textbox below where I could write a project number.

    When I save the new task for the first time outlook would automatically create a rule that would move new received emails with the given project number in the subject to a new folder with the same name as the task. And also if the incoming email has an attachment a copy of the message would be saved in a subfolder of the project labeled as documents.

    Wednesday, July 18, 2012 2:32 PM

Answers

All replies

  • You can work with the Rules collection and the Rule object to easily create the rule you want.  Here's a great sample:

    How to: Create a Rule to Move Specific E-mails to a Folder:
    http://msdn.microsoft.com/en-us/library/ff869653.aspx


    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Wednesday, July 18, 2012 2:52 PM
    Moderator
  • What version of Outlook?
     
    What type of code are you using (COM addin, VBA macro code, custom form code)?
     
    What is and isn't working, and do you have any specific questions?
     
    If you are using Outlook 2007 or higher you can create a rule like that by specifying a condition of olConditionSubject with your required text, and another condition of HasAttachment.
     
    The VBA Object Browser Help has pretty good information on the Rules objects and how to create rules in code.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "jnakij" <=?utf-8?B?am5ha2lq?=> wrote in message news:8c503844-7104-4619-ab40-20101dc01792...

    I'm trying to get the following to work:

    When creating a new task the form would have a checkbox labeled "create rules?"

    If the checkbox is checked, there would be a textbox below where I could write a project number.

    When I save the new task for the first time outlook would automatically create a rule that would move new received emails with the given project number in the subject to a new folder with the same name as the task. And also if the incoming email has an attachment a copy of the message would be saved in a subfolder of the project labeled as documents.


    Ken Slovak MVP - Outlook
    Wednesday, July 18, 2012 2:57 PM
    Moderator