Beispiel #1
0
        private void LaunchClientDoc(string docType)
        {
            try
            {
                ClientForm myForm = new ClientForm();
                myForm.ShowDialog();
                XLMain.Client selectedClient = myForm.selectedClient;
                if (selectedClient != null)
                {
                    string crmId = selectedClient.crmID;
                    XLDocument.openTemplate(docType);
                    XLDocument.UpdateParameter("CRMid", crmId);
                    XLDocument.UpdateParameter("DocType", docType);

                    //this appears to work in 3.5 notwithstanding the reference to Globals
                    xlTaskPane1              = new XLTaskPane();
                    CustomxlTaskPane         = Globals.ThisAddIn.CustomTaskPanes.Add(xlTaskPane1, "XLant Document Handler", Globals.ThisAddIn.Application.ActiveWindow);
                    CustomxlTaskPane.Visible = true;
                    CustomxlTaskPane.Width   = 350;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Unable to launch document");
                XLtools.LogException("LaunchClientDoc", docType + " - " + e.ToString());
            }
        }