Office add in tutorial
Next, we are going to see how to get others objects model. Application Object and the Others Model Objects
#Office add in tutorial code#
However, if it's needed to perform some code when the Outlook is being closed, you can check this link for an alternative. But it is important to say that in the current version, this method is not being called due to performance issues. The ThisAddIn_Shutdown method is executed when the user closes the Outlook.
Also, we can perform our initialization processes such as configurations and access to a database. In this method, we can get the object Application and the other objects model. The ThisAddIn_Startup method is the application starting point. This.Shutdown += new System.EventHandler(ThisAddIn_Shutdown) This.Startup += new System.EventHandler(ThisAddIn_Startup) / the contents of this method with the code editor. / /// Required method for Designer support - do not modify If you have code that // must run when Outlook shuts down, see // Note: Outlook no longer raises this event. Private void ThisAddIn_Shutdown( object sender, System.EventArgs e) Private void ThisAddIn_Startup( object sender, System.EventArgs e) The main class is ThisAddIn and is like this: