Results 1 to 3 of 3

Thread: Create or Import a Outlook Rule through C# code.

  1. #1
    JIGNESH Guest

    Default Create or Import a Outlook Rule through C# code.

    Outlook 2007
    ..NET 3.5 with VS2008.

    In outlook manually i can create a rule which looks like below. I am looking
    for a code sample which can do the same. Rule is :-

    "Apply this rule after message arrives
    with "ABC" in the subject
    reply using "c:\users\xxxxxx...\Templates\STDReply.oft"
    and delete it"

    if via code its not possible, then I am looking for some code, which can
    help me to import the Rule file containing above rule.

    Any Directions, Clue, Code Sample/ Hit will help.

    Note: I had a looked at Outlook.Rule object, but I could not found my
    solution.

    Regards


  2. #2
    Sue Mosher [MVP] Guest

    Default RE: Create or Import a Outlook Rule through C# code.

    Yes, it's possible, using the Outlook.Rule object, which is documented in
    detail here:

    Overview
    http://msdn.microsoft.com/en-us/library/bb206763.aspx

    Rule Conditions
    http://msdn.microsoft.com/en-us/library/bb206766.aspx

    Rule Actions including olRuleActionTemplate and olRuleActionDelete
    http://msdn.microsoft.com/en-us/library/bb206764.aspx
    --
    --
    Sue Mosher, Outlook MVP
    Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
    http://www.outlookcode.com/article.aspx?id=54



    "JIGNESH" wrote:

    > Outlook 2007
    > .NET 3.5 with VS2008.
    >
    > In outlook manually i can create a rule which looks like below. I am looking
    > for a code sample which can do the same. Rule is :-
    >
    > "Apply this rule after message arrives
    > with "ABC" in the subject
    > reply using "c:\users\xxxxxx...\Templates\STDReply.oft"
    > and delete it"
    >
    > if via code its not possible, then I am looking for some code, which can
    > help me to import the Rule file containing above rule.
    >
    > Any Directions, Clue, Code Sample/ Hit will help.
    >
    > Note: I had a looked at Outlook.Rule object, but I could not found my
    > solution.
    >
    > Regards
    >


  3. #3
    JIGNESH Guest

    Default RE: Create or Import a Outlook Rule through C# code.

    Hi Sue,

    On Page http://msdn.microsoft.com/en-us/library/bb206764.aspx
    The Table says..

    olRuleActionTemplate is NOT supported when creating new rules
    programmatically.

    So what is the work around for this. Is there any code sample on this?

    Regards


    "Sue Mosher [MVP]" wrote:

    > Yes, it's possible, using the Outlook.Rule object, which is documented in
    > detail here:
    >
    > Overview
    > http://msdn.microsoft.com/en-us/library/bb206763.aspx
    >
    > Rule Conditions
    > http://msdn.microsoft.com/en-us/library/bb206766.aspx
    >
    > Rule Actions including olRuleActionTemplate and olRuleActionDelete
    > http://msdn.microsoft.com/en-us/library/bb206764.aspx
    > --
    > --
    > Sue Mosher, Outlook MVP
    > Author of Microsoft Outlook 2007 Programming:
    > Jumpstart for Power Users and Administrators
    > http://www.outlookcode.com/article.aspx?id=54
    >
    >
    >
    > "JIGNESH" wrote:
    >
    > > Outlook 2007
    > > .NET 3.5 with VS2008.
    > >
    > > In outlook manually i can create a rule which looks like below. I am looking
    > > for a code sample which can do the same. Rule is :-
    > >
    > > "Apply this rule after message arrives
    > > with "ABC" in the subject
    > > reply using "c:\users\xxxxxx...\Templates\STDReply.oft"
    > > and delete it"
    > >
    > > if via code its not possible, then I am looking for some code, which can
    > > help me to import the Rule file containing above rule.
    > >
    > > Any Directions, Clue, Code Sample/ Hit will help.
    > >
    > > Note: I had a looked at Outlook.Rule object, but I could not found my
    > > solution.
    > >
    > > Regards
    > >


Similar Threads

  1. [SOLVED] How do I create and send mail in Outlook 2003 from code?
    By bluejamul in forum Using Outlook
    Replies: 5
    Last Post: 09-04-2011, 08:39 PM
  2. Cannot create new Outlook account - error code 0x80070057
    By John Blackwell in forum Using Outlook
    Replies: 7
    Last Post: 12-24-2010, 08:05 AM
  3. Create a macro in Outlook to run a rule
    By DLGolfs in forum Programming VBA Archive
    Replies: 32
    Last Post: 03-30-2010, 08:17 AM
  4. Create an Outlook Rule with an Alias
    By hanlee888 in forum Using Outlook
    Replies: 2
    Last Post: 03-01-2010, 09:07 PM
  5. forcing a rule when opening outlook via code
    By thomas donino in forum Programming VBA Archive
    Replies: 1
    Last Post: 11-23-2009, 10:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •