Microsoft Office Tutorials and References
In Depth Information
Dynamically add a slide and set title text in the presentation
PacktPresentationAdd)
{
// Create presentation in powerpoint
PowerPoint.Presentation PacktPowerPresent = this.Application.
Presentations.Add(Microsoft.Office.Core.
MsoTriState.msoTrue);
// Create the custom layout
PowerPoint.CustomLayout PacktLayout = PacktPowerPresent.
SlideMaster.CustomLayouts[PowerPoint.PpSlideLayout.
ppLayoutTitle];
// Add slide to it
PowerPoint.Slide PacktSlide = PacktPowerPresent.Slides.
AddSlide(1,PacktLayout);
// Set the title text for the slide
PacktSlide.Shapes.Title.TextFrame.TextRange.Text = "Book For
PacktPub";
// Set the text message in the slide
PacktSlide.Shapes[2].TextFrame.TextRange.Text = "Microsoft
Office 2007 Programming";
}
When you execute this code, you will see a slide and the text, Book For Packtpub , as
default text, as shown in the following screenshot:
 
Search JabSto ::




Custom Search