PC Review


Reply
Thread Tools Rate Thread

Create or Import a Outlook Rule through C# code.

 
 
JIGNESH
Guest
Posts: n/a
 
      31st May 2010
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

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      31st May 2010
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
>

 
Reply With Quote
 
JIGNESH
Guest
Posts: n/a
 
      31st May 2010
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
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I create an import spec in Outlook to import Access calend. =?Utf-8?B?Q29yeQ==?= Microsoft Outlook VBA Programming 1 8th May 2007 04:25 PM
Outlook 2003 import rule =?Utf-8?B?V2lsbGlhbSBI?= Microsoft Outlook Discussion 0 14th Feb 2007 09:31 PM
Create Button Code to Import Table =?Utf-8?B?RnJhbmsgV2FnbmVy?= Microsoft Access Form Coding 2 23rd Sep 2005 03:37 PM
Outlook 'create rule' should allow rule for no sender or subject =?Utf-8?B?R3JlZyBN?= Microsoft Outlook Discussion 2 29th Jul 2005 08:11 PM
Outlook automatic folder creation on rule import =?Utf-8?B?bWVsX2JhZ2xleQ==?= Microsoft Outlook Discussion 1 24th Mar 2005 03:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 AM.