locked
VISTO Outlook Add-In Auto Format Rule Filter Not Working RRS feed

  • Question

  • I have the code below that is suppose to create a rule and use the filter but its not The Settings are changing but the filter is not being applied. Also the View is changing the Table columns when applied.

    var rule = caseView.AutoFormatRules.Add("ProjectFilteringRule_" + Prj.Id.ToString());
                string MsgGuid = ServiceConnector.GetMessagesGuid();
                //0d6616a3-2e7d-74e4-be6e-52f7a788989d
                rule.Filter = "=\"http://schemas.microsoft.com/mapi/string/{" + MsgGuid + "}/ProjectFilteringTag\" LIKE \"%{" + Prj.Id.ToString() + "}%\"";
                if (Prj != null) {
                    if (Prj.OutlookSettings != null) {
                        if (Prj.OutlookSettings.FontWeight.Equals("bold")) {
                            rule.Font.Bold = true;
                        }
                        if (Prj.OutlookSettings.FontStyle.Equals("italic")) {
                            rule.Font.Italic = true;
                        }
                        if (Prj.OutlookSettings.FontSize > 0) {
                            if (Prj.OutlookSettings.FontSize < 17) {
                                rule.Font.Size = 18;// Prj.OutlookSettings.FontSize;
                            } else {
                                rule.Font.Size = 18;
                            }
                        }
                        if (Prj.OutlookSettings.FontColor != null) {
                            rule.Font.Color = OlColor.olColorRed;
                            //rule.Font.Color = (OlColor)ColorTranslator.ToWin32(Color.FromArgb(Prj.OutlookSettings.FontColor.r, Prj.OutlookSettings.FontColor.g, Prj.OutlookSettings.FontColor.b));
                        }
                    }
                }
                rule.Enabled = true;
                caseView.Save();
                caseView.Apply();


    • Edited by Scott Wagner AFLLC Thursday, September 13, 2018 9:16 PM
    • Moved by CoolDadTx Friday, September 14, 2018 1:45 PM Office related
    Thursday, September 13, 2018 6:46 PM

Answers

  • Hi Scott Wagner AFLLC,

    Thank you for posing here.

    Since your question is more related to VSTO, you could post a new thread in VSTO forum for suitable support.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=vsto&filter=alltypes&sort=lastpostdesc

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 14, 2018 7:21 AM

All replies

  • Hi Scott Wagner AFLLC,

    Thank you for posing here.

    Since your question is more related to VSTO, you could post a new thread in VSTO forum for suitable support.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=vsto&filter=alltypes&sort=lastpostdesc

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 14, 2018 7:21 AM
  • Posted here.

    https://social.msdn.microsoft.com/Forums/en-US/c19b69f7-0248-47ad-870a-86d7b3458356/visto-outlook-addin-auto-format-rule-filter-not-working?forum=vsto

    Friday, September 14, 2018 11:16 AM