public Microsoft.Office.Interop.PowerPoint.Slide Add(Microsoft.Office.Interop.PowerPoint.PpSlideLayout layout, string title)
 {
     Microsoft.Office.Interop.PowerPoint.Slide     slide;
     Microsoft.Office.Interop.PowerPoint.TextRange textRange;
     slide          = slides.Add(slides.Count + 1, layout);
     textRange      = slide.Shapes[1].TextFrame.TextRange;
     textRange.Text = title;
     return(slide);
 }
Beispiel #2
0
            public static void addText()
            {
                try
                {
                    //addind text to the slides
                    objSlide   = objSlides.Add(1, Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
                    objTextRng = objSlide.Shapes[1].TextFrame.TextRange;

                    objTextRng.Text      = "VDI POWER POINT TEST";
                    objTextRng.Font.Name = "Comic Sans MS";
                    objTextRng.Font.Size = 48;
                }
                catch (Exception e)
                {
                    Console.WriteLine("Adding Text to " + fileName + " failed");
                }
            }