Example #1
0
        private void cmb_stDate_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                int l = cmb_stDate.SelectedIndex;
                cmb_endDate.Items.Clear();
                for (int i = l; i < num_points; i++)
                {
                    string xx = Regex.Match(chtData[i, 0], @"\d+").Value;
                    cmb_endDate.Items.Add(xx);
                }
                cmb_endDate.SelectedIndex = cmb_endDate.Items.Count - 1;
                //Calculate_CAGR();

                string cmbText = cmb_calcType.Text;
                if (cmbText == "AAGR")
                {
                    Calculate_AAGR();
                }
                else
                {
                    Calculate_CAGR();
                }
            }
            catch (Exception err)
            {
                this.Close();
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "cmb_stDate_SelectedIndexChanged");
                MessageBox.Show("Check chart type and chart value", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        public string SelectedShapeNumber(int sldNum, PowerPoint.Shape selShape)
        {
            string selshpname = null;

            try
            {
                string selShpName = selShape.Name;
                float  selShpWd   = selShape.Width;
                float  selShpHt   = selShape.Height;
                float  selShpLf   = selShape.Left;
                float  selShpTp   = selShape.Top;

                for (int sn = 1; sn <= ActivePPT.Slides[sldNum].Shapes.Count; sn++)
                {
                    string tempShpName = ActivePPT.Slides[sldNum].Shapes[sn].Name;
                    float  tempShpWd   = ActivePPT.Slides[sldNum].Shapes[sn].Width;
                    float  tempShpHt   = ActivePPT.Slides[sldNum].Shapes[sn].Height;
                    float  tempShpLf   = ActivePPT.Slides[sldNum].Shapes[sn].Left;
                    float  tempShpTp   = ActivePPT.Slides[sldNum].Shapes[sn].Top;
                    if (tempShpName == selShpName && tempShpWd == selShpWd && tempShpHt == selShpHt && tempShpLf == selShpLf && tempShpTp == selShpTp)
                    {
                        selshpname = ActivePPT.Slides[sldNum].Shapes[sn].Name;
                        break;
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "SelectedShapeNumber");
            }
            return(selshpname);
        }
Example #3
0
        public void Format_Series(PowerPoint.Chart myChart, bool hasYAxis, string chType)
        {
            try
            {
                //bool secAxis = false;
                PowerPoint.SeriesCollection sc = myChart.SeriesCollection();
                if (chType == "Pie" || chType == "Doughnut" || chType == "Surface")
                {
                    return;
                }
                if (chType == "Column")
                {
                    for (int i = 1; i <= sc.Count; i++)
                    {
                        PowerPoint.Series chartSeries = myChart.SeriesCollection(i);

                        myChart.SeriesCollection(i).Format.Line.Visible       = MsoTriState.msoTrue;
                        myChart.SeriesCollection(i).Format.Line.ForeColor.RGB = System.Drawing.Color.FromArgb(255, 255, 255).ToArgb();
                        chartSeries.Format.Line.Weight = (float)0.75;
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "Format_PlotArea");
            }
        }
Example #4
0
        public void DeleteFormatComments_M1(int sldNum)
        {
            int numComments = ActivePPT.Slides[sldNum].Comments.Count;

            try
            {
                if (numComments > 0)
                {
                    for (int xx = numComments; xx >= 1; xx--)
                    {
                        PowerPoint.Comment myComment = ActivePPT.Slides[sldNum].Comments[xx];
                        if (myComment.AuthorInitials == "TFR")
                        //if (myComment.Author == shpName + " Error" && myComment.AuthorInitials == "TFR")
                        {
                            myComment.Delete();
                            // break;
                        }
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "DeleteFormatComments_M1");
            }
        }
Example #5
0
 public void Format_XGrids(PowerPoint.Chart myChart, bool hasXGrids, string chType)
 {
     try
     {
         if (chType == "Pie" || chType == "Doughnut")
         {
             if (hasXGrids == true)
             {
                 if (myChart.Axes(XlAxisType.xlCategory).HasMajorGridlines == true)
                 {
                     myChart.Axes(XlAxisType.xlCategory).MajorGridlines.Border.Color     = System.Drawing.Color.FromArgb(127, 127, 127).ToArgb();
                     myChart.Axes(XlAxisType.xlCategory).MajorGridlines.Border.LineStyle = PowerPoint.XlLineStyle.xlDot;
                 }
             }
             else if (hasXGrids == false)
             {
                 myChart.HasAxis[XlAxisType.xlCategory] = false;
             }
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "Format_XGrids");
     }
 }
Example #6
0
 //'This function formats the y-grids line style, tick marks, title and ticklables font name, style, size, color, sub-super script, underline
 public void Format_YGrids(PowerPoint.Chart myChart, bool hasYAxis, string chType, bool ch3D)
 {
     try
     {
         bool hasYGrids = false;
         if (chType == "Pie" || chType == "Doughnut")
         {
             return;
         }
         if (chType == "Radar" || (hasYAxis && ch3D == true))
         {
             hasYGrids = true;
         }
         if (hasYGrids == true)
         {
             myChart.Axes(XlAxisType.xlValue).HasMajorGridlines               = true;
             myChart.Axes(XlAxisType.xlValue).MajorGridlines.Border.Color     = System.Drawing.Color.FromArgb(127, 127, 127).ToArgb();
             myChart.Axes(XlAxisType.xlValue).MajorGridlines.Border.LineStyle = PowerPoint.XlLineStyle.xlContinuous;
         }
         else if (hasYGrids == false)
         {
             myChart.Axes(XlAxisType.xlValue).HasMajorGridlines = false;
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "Format_YGrids");
     }
 }
Example #7
0
        public void DeleteFormatComments_M3(int sldnum)
        {
            int numComments = ActivePPT.Slides[sldnum].Comments.Count;

            PowerPoint.Comment myComment = null;
            try
            {
                if (numComments > 0)
                {
                    for (int i = numComments; i >= 1; i--)
                    {
                        myComment = ActivePPT.Slides[sldnum].Comments[i];
                        if (myComment.AuthorInitials == "TFR")
                        {
                            myComment.Delete();
                        }
                    } // ---
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "DeleteFormatComments_M3");
            }
        }
Example #8
0
        public void CreateBullet(int sldNum, string shpname)
        {
            try
            {
                PowerPoint.TextRange txtRng = ActivePPT.Slides[sldNum].Shapes[shpname].TextFrame.TextRange;

                float indentVal  = (float)0.64;
                var   paragraphs = txtRng.Paragraphs(-1, -1);

                for (int index = 1; index <= txtRng.Paragraphs().Count; index++)
                {
                    //string paraText = txtRng.Paragraphs(index).Text;

                    txtRng.Paragraphs(index).IndentLevel = index;
                    txtRng.Paragraphs(index).ParagraphFormat.Alignment              = PowerPoint.PpParagraphAlignment.ppAlignLeft;
                    txtRng.Paragraphs(index).ParagraphFormat.HangingPunctuation     = MsoTriState.msoTrue;
                    txtRng.Paragraphs(index).ParagraphFormat.SpaceBefore            = 6;
                    txtRng.Paragraphs(index).ParagraphFormat.SpaceAfter             = 0;
                    txtRng.Paragraphs(index).ParagraphFormat.SpaceWithin            = (float)0.85;
                    txtRng.Paragraphs(index).Parent.Ruler.Levels[index].FirstMargin = indentVal;//18 * (index - 1);
                    txtRng.Paragraphs(index).Parent.Ruler.Levels[index].LeftMargin  = 18 * (index);
                    indentVal = indentVal + (float)0.47;
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "CreateBullet");
            }
        }
Example #9
0
 public MsoTriState getMsoTriState(int dbVal)
 {
     //int dbVal = Convert.ToInt32(dt.Rows[0]["FillVisible"]);
     try
     {
         if (dbVal == 1)
         {
             objValue = MsoTriState.msoCTrue;
         }
         else if (dbVal == 0)
         {
             objValue = MsoTriState.msoFalse;
         }
         else if (dbVal == -2)
         {
             objValue = MsoTriState.msoTriStateMixed;
         }
         else if (dbVal == -3)
         {
             objValue = MsoTriState.msoTriStateToggle;
         }
         else if (dbVal == -1)
         {
             objValue = MsoTriState.msoTrue;
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "getMsoTriState");
     }
     return(objValue);
 }
Example #10
0
 // -- Main method to correct Each shapes format
 public void CorrectFormat_Selected(int sldNum, string shpName)
 {
     try
     {
         PowerPoint.Presentation ActivePPT = ppApp.ActivePresentation;
         CorrectFormat_ShapeInSlide(sldNum, shpName);
         if (ActivePPT.Slides[sldNum].CustomLayout.Name == "Title Slide")
         {
             CorrectFormat_TitleSlide(sldNum, shpName);
         }
         else if (ActivePPT.Slides[sldNum].CustomLayout.Name == "Content Slide")
         {
             CorrectFormat_ContentSlide(sldNum, shpName);
         }
         else if (ActivePPT.Slides[sldNum].CustomLayout.Name == "Divider Slide")
         {
             CorrectFormat_DividerSlide(sldNum, shpName);
         }
         else
         {
             CorrectFormat_MainSlide(sldNum, shpName);
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "CorrectFormat_Selected");
     }
 }
Example #11
0
        public void SetNamesUnique(int sldNum)
        {
            int shpCount = ActivePPT.Slides[sldNum].Shapes.Count;

            try
            {
                for (int i = 1; i <= shpCount; i++)
                {
                    PowerPoint.Shape osh = ActivePPT.Slides[sldNum].Shapes[i];
                    if (osh.Type == MsoShapeType.msoGroup)
                    {
                        for (int x = 1; x <= osh.GroupItems.Count; x++)
                        {
                            string shpName = osh.GroupItems[x].Name;
                            ChangeNames(sldNum, shpName, x);
                        }
                    }
                    else
                    {
                        string shpName = osh.Name;
                        ChangeNames(sldNum, shpName, i);
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "SetNamesUnique");
            }
        }
Example #12
0
        public void btnformatTable_Click(Office.IRibbonControl rib, string galleryID, int selectedIndex)
        {
            pptfunctions funObj  = new pptfunctions();
            string       tbltype = null;

            if (funObj.TSCThemeLoaded())
            {
                clstblformat tableObj = new clstblformat();

                switch (galleryID)
                {
                case "ftable1": { tbltype = "Atable1"; break; }

                case "ftable2": { tbltype = "Atable2"; break; }

                case "ftable3": { tbltype = "Atable3"; break; }

                case "ftable4": { tbltype = "Atable4"; break; }

                case "ftable5": { tbltype = "Atable5"; break; }

                case "ftable6": { tbltype = "Atable6"; break; }

                case "ftable7": { tbltype = "Atable7"; break; }

                case "ftable8": { tbltype = "Atable8"; break; }
                }
                tableObj.tableformat(tbltype);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Example #13
0
 public static void saveSpacification(StringBuilder str, string shpName)
 {
     try
     {
         string newPath = logfile + @"TheSmartCube\Log\";
         string path    = newPath + "Spacification_" + shpName + ".txt";
         if (!File.Exists(path))
         {
             using (StreamWriter sw = File.CreateText(path))
             {
                 sw.WriteLine(str);
                 sw.Close();
             }
         }
         else if (File.Exists(path))
         {
             using (StreamWriter sw = File.AppendText(path))
             {
                 sw.WriteLine(str);
                 sw.Close();
             }
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "saveSpacification");
     }
 }
Example #14
0
        public void CorrectFormat_DividerSlide(int sldNum, string shpName)
        {
            try
            {
                PowerPoint.Shape shp = ActivePPT.Slides[sldNum].Shapes[shpName];
                if (shp.Type == MsoShapeType.msoAutoShape || shp.Type == MsoShapeType.msoPlaceholder || shp.Type == MsoShapeType.msoTextBox)
                {
                    if (shp.HasTextFrame == MsoTriState.msoTrue)
                    {
                        DataTable dt1    = actionObj.get_specification("Section Title");
                        string    STitle = chkObj.CheckIfBoxAlreadyExist1(sldNum, dt1);

                        DataTable dt2      = actionObj.get_specification("Section Content");
                        string    SContent = chkObj.CheckIfBoxAlreadyExist1(sldNum, dt2);

                        if (shpName == STitle && dt1.Rows.Count != 0)
                        {
                            FormatShape(sldNum, shpName, dt1, false);
                        }
                        else if (shpName == SContent && dt2.Rows.Count != 0)
                        {
                            FormatShape(sldNum, shpName, dt2, false);
                        }
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "CorrectFormat_DividerSlide");
            }
        }
Example #15
0
        public void btnInsertTable_Click(Office.IRibbonControl rib, string galleryID, int selectedIndex)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                frmtable tableObj = new frmtable();

                switch (galleryID)
                {
                case "Atable1": { PPTAttribute.tableType.Add("Atable1"); break; }

                case "Atable2": { PPTAttribute.tableType.Add("Atable2"); break; }

                case "Atable3": { PPTAttribute.tableType.Add("Atable3"); break; }

                case "Atable4": { PPTAttribute.tableType.Add("Atable4"); break; }

                case "Atable5": { PPTAttribute.tableType.Add("Atable5"); break; }

                case "Atable6": { PPTAttribute.tableType.Add("Atable6"); break; }

                case "Atable7": { PPTAttribute.tableType.Add("Atable7"); break; }

                case "Atable8": { PPTAttribute.tableType.Add("Atable8"); break; }
                }
                tableObj.ShowDialog();
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Example #16
0
 public PowerPoint.PpChangeCase txtChangeCase(int dbVal)
 {
     try
     {
         if (dbVal == 2)
         {
             objValue4 = PowerPoint.PpChangeCase.ppCaseLower;
         }
         else if (dbVal == 1)
         {
             objValue4 = PowerPoint.PpChangeCase.ppCaseSentence;
         }
         else if (dbVal == 4)
         {
             objValue4 = PowerPoint.PpChangeCase.ppCaseTitle;
         }
         else if (dbVal == 5)
         {
             objValue4 = PowerPoint.PpChangeCase.ppCaseToggle;
         }
         else if (dbVal == 3)
         {
             objValue4 = PowerPoint.PpChangeCase.ppCaseUpper;
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "txtChangeCase");
     }
     return(objValue4);
 }
Example #17
0
 public PowerPoint.PpBulletType getPpBulletType(int dbVal)
 {
     try
     {
         if (dbVal == 1)
         {
             objValue5 = PowerPoint.PpBulletType.ppBulletUnnumbered;
         }
         else if (dbVal == -2)
         {
             objValue5 = PowerPoint.PpBulletType.ppBulletMixed;
         }
         else if (dbVal == 0)
         {
             objValue5 = PowerPoint.PpBulletType.ppBulletNone;
         }
         else if (dbVal == 2)
         {
             objValue5 = PowerPoint.PpBulletType.ppBulletNumbered;
         }
         else if (dbVal == 3)
         {
             objValue5 = PowerPoint.PpBulletType.ppBulletPicture;
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "getPpBulletType");
     }
     return(objValue5);
 }
Example #18
0
        //Start a new presentation with TSC 2015 Theme.
        public void TSCP_Callback12(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            funObj.addNewPPT_In_tsc_format(rib);
            PPTAttribute.UserTracker(rib);
        }
Example #19
0
 public void ChangeNames(int sldNum, string shpName, int index)
 {
     try
     {
         for (int j = 1; j <= ActivePPT.Slides[sldNum].Shapes.Count; j++)
         {
             PowerPoint.Shape osh1 = ActivePPT.Slides[sldNum].Shapes[j];
             if (osh1.Type == MsoShapeType.msoGroup)
             {
                 for (int y = 1; y <= osh1.GroupItems.Count; y++)
                 {
                     string tName = osh1.GroupItems[y].Name;
                     if (tName == shpName && y != index)
                     {
                         osh1.GroupItems[y].Name = osh1.GroupItems[y].Name + "_C";
                     }
                 }
             }
             else
             {
                 string tName = osh1.Name;
                 if (tName == shpName && j != index)
                 {
                     osh1.Name = osh1.Name + "_C";
                 }
             }
         }
     }
     catch (Exception err)
     {
         string errtext = err.Message;
         PPTAttribute.ErrorLog(errtext, "ChangeNames");
     }
 }
Example #20
0
        public void TSCP_Callback82(Office.IRibbonControl rib)
        {
            tscformat choObj = new tscformat();

            choObj.tsc_loadtheme();
            PPTAttribute.UserTracker(rib);
        }
Example #21
0
        public void btnformatPPT_Click(Office.IRibbonControl rib)
        {
            frmPPTFormat frmObj = new frmPPTFormat();
            pptfunctions funObj = new pptfunctions();

            frmObj.ShowDialog();
            PPTAttribute.UserTracker(rib);
        }
Example #22
0
        //Load TSC 2018 Theme in active presentation.
        public void TSCP_Callback11(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            funObj.ApplyPPT_Theme(rib);
            PPTAttribute.UserTracker(rib);
            //this.ribbon.InvalidateControl("customButton13");
        }
Example #23
0
 public void btnfeedback_Click(Office.IRibbonControl rib)
 {
     Outlook.Application mailObj = Marshal.GetActiveObject("Outlook.Application") as Outlook.Application;
     Outlook.MailItem    newmail = mailObj.CreateItem(Outlook.OlItemType.olMailItem);
     newmail.Subject = "Feedback - TSC PPT Addin";
     newmail.To      = "[email protected];[email protected]";
     newmail.Display();
     PPTAttribute.UserTracker(rib);
 }
Example #24
0
        public static void ErrorLog(string ErrDis, string rib)
        {
            String strUserName;
            String strWholeText;

            try
            {
                PowerPoint.Presentation ActivePPT = Globals.ThisAddIn.Application.ActivePresentation;
                string newPath;
                if (!Directory.Exists(logfile + @"TheSmartCube\Log\"))
                {
                    newPath = logfile + @"TheSmartCube\Log\";
                }
                else
                {
                    newPath = logfile + @"TheSmartCube\Log\";
                }
                System.IO.Directory.CreateDirectory(newPath);
                string path = newPath + "ErrorLog_" + DateTime.Now.ToString("ddMMyyyy") + ".txt";
                strUserName = Environment.UserName;
                if (rib.Length <= 12)
                {
                    return;
                }
                if (getButtonDiscription(rib) != null)
                {
                    strWholeText = strUserName + "|" + getButtonDiscription(rib) + "|" + ErrDis + "|" + DateTime.Now.ToString() + "|" + ActivePPT.Name;
                }
                else
                {
                    strWholeText = strUserName + "|" + rib + "|" + ErrDis + "|" + DateTime.Now.ToString() + "|" + ActivePPT.Name;
                }
                if (!File.Exists(path))
                {
                    //File.Create(path);
                    using (StreamWriter sw = File.CreateText(path))
                    {
                        sw.WriteLine(strWholeText);
                        sw.Close();
                    }
                }
                else if (File.Exists(path))
                {
                    using (StreamWriter sw = File.AppendText(path))
                    {
                        sw.WriteLine(strWholeText);
                        sw.Close();
                    }
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "ErrorLog");
            }
        }
Example #25
0
        //Growth Rates
        public void TSCP_Callback51(Office.IRibbonControl rib)
        {
            PowerPoint.Application ppApp    = Globals.ThisAddIn.Application;
            pptfunctions           funObj   = new pptfunctions();
            Shapecheck             shpObj   = new Shapecheck();
            frmChartcalc           chartObj = new frmChartcalc();
            //frmCalculator frmObj = new frmCalculator();
            Shapecheck    PPTshpchk      = new Shapecheck();
            List <string> SelectedCharts = new List <string>();

            SelectedCharts = PPTshpchk.FindSelectedCharts();
            PowerPoint.Presentation ActivePPT = Globals.ThisAddIn.Application.ActivePresentation;
            int numSelCht = SelectedCharts.Count;

            if (numSelCht == 0)
            {
                MessageBox.Show("Please select a chart for CAGR/AAGR calculation.", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            int sld_num = ppApp.ActiveWindow.Selection.SlideRange.SlideNumber;

            PowerPoint.Chart myChart = ActivePPT.Slides[sld_num].Shapes[SelectedCharts[0]].Chart;
            string           chType  = shpObj.chartType(myChart);

            if (funObj.TSCThemeLoaded())
            {
                if (numSelCht == 0)
                {
                    //frmObj.Show();
                    MessageBox.Show("Please select a chart CAGR/AAGR calculation.", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (numSelCht > 1)
                {
                    MessageBox.Show("Please select a single chart CAGR/AAGR calculation.", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (numSelCht == 1)
                {
                    //PPT.Chart myChart =
                    //string chType = PPTshpchk.chartType();
                    if (chType != "Pie")
                    {
                        chartObj.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Please select a column chart for CAGR/AAGR Calculation.", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Example #26
0
        public bool chart3D(PowerPoint.Chart myChart)
        {
            bool chart3dVal = false;

            try
            {
                if (myChart.ChartType == XlChartType.xl3DBarClustered || myChart.ChartType == XlChartType.xl3DBarStacked || myChart.ChartType == XlChartType.xl3DBarStacked100 ||
                    myChart.ChartType == XlChartType.xlCylinderBarClustered || myChart.ChartType == XlChartType.xlCylinderBarStacked || myChart.ChartType == XlChartType.xlCylinderBarStacked100 ||
                    myChart.ChartType == XlChartType.xlConeBarClustered || myChart.ChartType == XlChartType.xlConeBarStacked || myChart.ChartType == XlChartType.xlConeBarStacked100 ||
                    myChart.ChartType == XlChartType.xlPyramidBarClustered || myChart.ChartType == XlChartType.xlPyramidBarStacked || myChart.ChartType == XlChartType.xlPyramidBarStacked100)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xl3DColumnClustered || myChart.ChartType == XlChartType.xl3DColumnStacked || myChart.ChartType == XlChartType.xl3DColumnStacked100 ||
                         myChart.ChartType == XlChartType.xlCylinderColClustered || myChart.ChartType == XlChartType.xlCylinderColStacked || myChart.ChartType == XlChartType.xlCylinderColStacked100 ||
                         myChart.ChartType == XlChartType.xlConeColClustered || myChart.ChartType == XlChartType.xlConeColStacked || myChart.ChartType == XlChartType.xlConeColStacked100 ||
                         myChart.ChartType == XlChartType.xlPyramidColClustered || myChart.ChartType == XlChartType.xlPyramidColStacked || myChart.ChartType == XlChartType.xlPyramidColStacked100 ||
                         myChart.ChartType == XlChartType.xl3DColumn || myChart.ChartType == XlChartType.xlConeCol || myChart.ChartType == XlChartType.xlCylinderCol || myChart.ChartType == XlChartType.xlPyramidCol)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xl3DLine)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xl3DPie || myChart.ChartType == XlChartType.xl3DPieExploded)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xl3DArea || myChart.ChartType == XlChartType.xl3DAreaStacked || myChart.ChartType == XlChartType.xl3DAreaStacked100)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xlBubble3DEffect)
                {
                    chart3dVal = true;
                }
                else if (myChart.ChartType == XlChartType.xlSurface || myChart.ChartType == XlChartType.xlSurfaceWireframe)
                {
                    chart3dVal = true;
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "chart3D");
            }

            return(chart3dVal);
        }
Example #27
0
        public void TSCP_Callback_Chart(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                funObj.InsertCharts(rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Example #28
0
        // Function chekc if shape allready exist the return shape name
        public string  CheckIfBoxAlreadyExist1(int sldIndex, DataTable dt)
        {
            int    boxNum      = 0;
            String returnValue = null;

            try
            {
                string shpName   = Convert.ToString(dt.Rows[0]["Name"]);
                float  shpLeft   = (float)Convert.ToDecimal((dt.Rows[0]["ShapeLeft"]));
                float  shpTop    = (float)Convert.ToDecimal((dt.Rows[0]["ShapeTop"]));
                float  shpWidth  = (float)Convert.ToDecimal((dt.Rows[0]["ShapeWidth"]));
                float  shpHeight = (float)Convert.ToDecimal((dt.Rows[0]["ShapeHeight"]));

                int shpCount = ActivePPT.Slides[sldIndex].Shapes.Count;
                int cnt      = 0;
                foreach (PowerPoint.Shape shp in ActivePPT.Slides[sldIndex].Shapes)
                {
                    if (shp.Name == shpName)
                    {
                        cnt++;
                    }
                }
                if (cnt == 0)
                {
                    boxNum = FindWhenNoBox(sldIndex, shpName, shpWidth, shpHeight, shpLeft, shpTop);
                }
                else if (cnt == 1)
                {
                    boxNum = FindWhenOneBox(sldIndex, shpName, shpWidth, shpHeight, shpLeft, shpTop);
                }
                else if (cnt > 1)
                {
                    boxNum = FindWhenMultipleBox(sldIndex, shpName, shpWidth, shpHeight, shpLeft, shpTop);
                }
                if (boxNum > 0)
                {
                    returnValue = ActivePPT.Slides[sldIndex].Shapes[boxNum].Name;
                }
                else
                {
                    returnValue = null;
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "CheckIfBoxAlreadyExist1");
            }
            return(returnValue);
        }
Example #29
0
        public void btnbullet_Click(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                funObj.formatbullettxt(rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Example #30
0
        public void btnSave_Click(Office.IRibbonControl rib)  //Maksood
        {
            clsSave csave = new clsSave();

            if (rib.Id == "btnSaveSelectedSlide")
            {
                csave.pSaveSelectedSlide();
            }
            else if (rib.Id == "btnSaveAllSlide")
            {
                csave.pSeprateEachSlide();
            }
            PPTAttribute.UserTracker(rib);
        }