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

How to create hidden rule in outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 28th 09, 01:53 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 15
Default How to create hidden rule in outlook 2007


Hi all,

I am developing outlook plug-in for outlook 2007. I have created
programmatic- ally rule and it works fine.This rule can see in 'Rules
and Alert' window.Can user hide this rule? or how can create hidden rule
and set it's execution order first?

Thanks in advance.


--

http://forums.slipstick.com

Ads
  #2  
Old December 28th 09, 03:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to create hidden rule in outlook 2007

If you use the rules object model the resulting rule cannot be hidden, it
will show up in the rules wizard. You would need to code the equivalent of
the rule as macro code or a COM addin and replace the rule completely.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


" nitwalkegmail.com.43wqdm@invalid wrote in message
news:nitwalkegmail.com.43wqdm@invalid...

Hi all,

I am developing outlook plug-in for outlook 2007. I have created
programmatic- ally rule and it works fine.This rule can see in 'Rules
and Alert' window.Can user hide this rule? or how can create hidden rule
and set it's execution order first?

Thanks in advance.


--

http://forums.slipstick.com


  #3  
Old December 29th 09, 08:34 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 15
Default How to create hidden rule in outlook 2007


Thanks for reply,

How can we use COM addin to replace the rule?Can I get some example? or
more explanation.
I have created COM addin and used rule object and rule can seen in rule
wizard.


Outlook.MAPIFolder inbox=
this.Application.Session.GetDefaultFolder(Microsof t.Office.Interop.Outlook.OlDefaultFolders.olFolder Inbox);
Outlook.MAPIFolder targetfolder = inbox.Folders["Test"];

rules = this.Application.Session.DefaultStore.GetRules();
rule = rules.Create("TestRule",
Microsoft.Office.Interop.Outlook.OlRuleType.olRule Receive);

Outlook.TextRuleCondition sub = rule.Conditions.Subject;
sub.Enabled = true;
sub.Text = new string[] {"Test Subject"};

movecopy = rule.Actions.MoveToFolder;
movecopy.Enabled = true;
movecopy.Folder = targetfolder;

rule.Execute(true, inbox, false,
Outlook.OlRuleExecuteOption.olRuleExecuteUnreadMes sages);

How COM addin can use to create hidden rule?

'Ken Slovak - [MVP - Outlook Wrote:
;109892']If you use the rules object model the resulting rule cannot be
hidden, it
will show up in the rules wizard. You would need to code the equivalent
of
the rule as macro code or a COM addin and replace the rule completely.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


" nitwalkegmail.com.43wqdm@invalid wrote in
message
news:nitwalkegmail.com.43wqdm@invalid...

Hi all,

I am developing outlook plug-in for outlook 2007. I have created
programmatic- ally rule and it works fine.This rule can see in

'Rules
and Alert' window.Can user hide this rule? or how can create hidden

rule
and set it's execution order first?

Thanks in advance.


--

http://forums.slipstick.com



--

http://forums.slipstick.com

  #4  
Old December 29th 09, 02:05 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to create hidden rule in outlook 2007

As I said, you cannot use an addin to create a hidden rule, there is no such
thing.

You would use code in an addin to replicate what your rule does, under the
same conditions. Since a rule runs when items are added to the Inbox, you
need an ItemAdd() handler for Inbox.Items or a handler for NewMailEx(). Then
you would test the incoming item for the same conditions the rule would test
for, and take the same action the rule would take. In this case you would
test the subject for certain text and move the item if the test was true.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


" nitwalkegmail.com.43y68a@invalid wrote in message
news:nitwalkegmail.com.43y68a@invalid...

Thanks for reply,

How can we use COM addin to replace the rule?Can I get some example? or
more explanation.
I have created COM addin and used rule object and rule can seen in rule
wizard.


Outlook.MAPIFolder inbox=
this.Application.Session.GetDefaultFolder(Microsof t.Office.Interop.Outlook.OlDefaultFolders.olFolder Inbox);
Outlook.MAPIFolder targetfolder = inbox.Folders["Test"];

rules = this.Application.Session.DefaultStore.GetRules();
rule = rules.Create("TestRule",
Microsoft.Office.Interop.Outlook.OlRuleType.olRule Receive);

Outlook.TextRuleCondition sub = rule.Conditions.Subject;
sub.Enabled = true;
sub.Text = new string[] {"Test Subject"};

movecopy = rule.Actions.MoveToFolder;
movecopy.Enabled = true;
movecopy.Folder = targetfolder;

rule.Execute(true, inbox, false,
Outlook.OlRuleExecuteOption.olRuleExecuteUnreadMes sages);

How COM addin can use to create hidden rule?


 




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
Hidden Contacts in Outlook 2007 rackerson Outlook - Using Contacts 5 January 30th 09 10:58 PM
how to create a rule in outlook 2003 ? create rulein outlook Outlook - General Queries 3 January 9th 08 01:35 PM
INVISIBLE or HIDDEN RULE? [email protected] Outlook - General Queries 6 February 23rd 07 12:54 PM
Outlook 2007 Hidden Folders? crashley Outlook - Installation 8 July 17th 06 10:01 PM
How to create a hidden message in a folder Davide Outlook - General Queries 4 February 1st 06 03:38 PM


All times are GMT +1. The time now is 08:57 AM.


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