Here is the code snippet…
private void AutoFormat()
{
try
{
AutoFormatRule afr;
TableView tv;
tv = applicationObject.ActiveExplorer().CurrentView;
MessageBox.Show(tv.AutoFormatRules.Count.ToString());
for (int i=1;i<=tv.AutoFormatRules.Count;i++)
{
AutoFormatRule rl = tv.AutoFormatRules[i];
if(rl.Name=="TestAFRule")
{
tv.AutoFormatRules.Remove(i);
MessageBox.Show("Deleted" + rl.Name);
}
}
afr = tv.AutoFormatRules.Add("TestAFRule");
afr.Font.Color = OlColor.olColorRed;
afr.Enabled = true;
tv.Save();
tv.Apply();
MessageBox.Show("Done");
}
catch(System.Exception ex)
{
MessageBox.Show("Err:" + ex.Message);
}
}
Advertisement
Could you help me
I need to create a rule in outlook for defer a delivery message
The code is like that :
Set colRules = Application.Session.DefaultStore.GetRules()
‘Create the rule by adding a SendRule to Rules collection
Set oRule = colRules.Create(“Envoi différé”, olRuleSend)
Set oDeferRuleAction = oRule.Actions(OlRuleActionType.olRuleActionDefer)
With oDeferRuleAction
.enabled = True
then the first action is activate “delete category” but not defer delivery and I can’t set a number of minutes
End With
some thing is missing I don’t know
tank’s a lot for your help