A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Create or Import a Outlook Rule through C# code.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 31st 10, 10:35 AM posted to microsoft.public.outlook.program_addins
JIGNESH
external usenet poster
 
Posts: 5
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

Ads
  #2  
Old May 31st 10, 12:21 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Create or Import a Outlook Rule through C# code.

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

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  
Old May 31st 10, 03:54 PM posted to microsoft.public.outlook.program_addins
JIGNESH
external usenet poster
 
Posts: 5
Default 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 he

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

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a macro in Outlook to run a rule DLGolfs Outlook and VBA 32 March 30th 10 02:17 PM
forcing a rule when opening outlook via code thomas donino Outlook and VBA 1 November 23rd 09 04:35 PM
is it possible to create a dynamic rule in outlook? Christopher J. Amatulli Outlook - Using Forms 8 October 29th 08 08:47 AM
how do I create an import spec in Outlook to import Access calend. Cory Outlook and VBA 1 May 8th 07 04:25 PM
How can I create a rule in Outlook 03 to Bcc to a Distribution lis BC Outlook - Installation 1 January 31st 06 05:02 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.