none
custom formregions and its events RRS feed

  • Question

  • i am trying to create an 2013 outlook add-in in a vsto 2017 environment.I used to handle the data-entry with an .oft form  where there existed events like item_load and ite_write. I will need an item_load but the most important for my design is that I face the problem that i can't differentiate among update\delete procedures.

    Is there a workaround?




    savvas

    Wednesday, January 16, 2019 9:00 PM

All replies

  • Hello,

    You may handle the following events that are available in the Outlook object model:

    1. Items.ItemChange - fired when an item in the specified collection is changed. 

    2. Items.ItemRemove - fired when an item is deleted from the specified collection. This event does not run when the last item in a Personal Folders file (.pst) is deleted, or if 16 or more items are deleted at once from a PST file, Microsoft Exchange mailbox, or an Exchange public folder. 

    There is no need to build an Outlook form region based on the .oft file any longer. Instead, you may design an Outlook form region in Visual Studio, see Walkthrough: Design an Outlook form region for more information.

    You can access the created Outlook form region at any time by using the following code:

    For Outlook Inspector windows:

    private void Access_Form_Regions_ByInspector()
    {
        WindowFormRegionCollection formRegions = 
            Globals.FormRegions
                [Globals.ThisAddIn.Application.ActiveInspector()];
        formRegions.FormRegion1.textBox1.Text = "Hello World";
    }
    For Outlook Explorer windows:
    private void Access_Form_Regions_ByExplorer()
    {
        WindowFormRegionCollection formRegions =
            Globals.FormRegions
                [Globals.ThisAddIn.Application.ActiveExplorer()];
        formRegions.FormRegion1.textBox1.Text = "Hello World";
    }

    Read more about that in the Access a form region at runtime article.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, January 17, 2019 2:42 PM