private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            // Enable the Add-in on start of Outlook.
            EnableAsposeWordsMetadata = true;
            try
            {
                // Apply the Aspose license from a file in the local file system, if it exists.
                string LicenceFilePath = String.IsNullOrEmpty(Properties.Settings.Default.AsposeLicense) ? "" : Properties.Settings.Default.AsposeLicense;
                try
                {
                    if (LicenceFilePath != "")
                    {
                        if (File.Exists(LicenceFilePath))
                        {
                            Words.License Lic = new Words.License();
                            Lic.SetLicense(LicenceFilePath);
                        }
                        else
                        {
                            MessageBox.Show("Aspose License file doesnot exist on the location");
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Not able to set license. Application will run in demo mode. Error: " + ex.Message);
                }

                // Start a plugin on email sent.
                Application.ItemSend += new
                                        Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error");
            }
        }
Beispiel #2
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            // Enable the Add-in on start of Outlook
            EnableAsposeWordsMetadata = true;
            try
            {
                // Apply License to Aspose if it exist
                string LicenceFilePath = String.IsNullOrEmpty(Properties.Settings.Default.AsposeLicense) ? "" : Properties.Settings.Default.AsposeLicense;
                try
                {
                    if (LicenceFilePath != "")
                    {
                        if (File.Exists(LicenceFilePath))
                        {
                            Words.License Lic = new Words.License();
                            Lic.SetLicense(LicenceFilePath);
                        }
                        else
                        {
                            MessageBox.Show("Aspose License file doesnot exist on the location");
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Not able to set license. Application will run in demo mode. Error: " + ex.Message);
                }

                // Start a plugin on email sent
                Application.ItemSend += new
            Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error");
            }
        }