yes scott iam importing that namespace i m writing in my button click event like this { int count = 0; string strTemplate = string.Empty; int shpCount = 1; //core.MsoTriState objTriState = core.MsoTriState.msoTrue; string strPPTName = @"d:\EDPresentation.pptx"; string strPPTPath = @"D:\PPT-Opty1\PPT-Opty\"; strTemplate = strPPTPath + "Presentation5.pptx"; Application objApp = new ApplicationClass(); _Presentation objPres = objApp.Presentations.Open(strTemplate, core.MsoTriState.msoFalse, core.MsoTriState.msoTrue, core.MsoTriState.msoFalse); Slides objSlides = objPres.Slides; TextRange objTextRng; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { objSlides.InsertFromFile(strTemplate,count, 1, 1); _Slide objSlide = objSlides[ds.Tables[0].Rows.Count-1]; //for (shpCount = 1; shpCount <= objSlide.Shapes.Count; shpCount++) //{ Microsoft.Office.Interop.PowerPoint.Shape objShape; // foreach (DataColumn dc in ds.Tables[0].Columns) // { // if (objSlide.Shapes[shpCount].AlternativeText.Trim().Equals(dc.ColumnName)) // { objShape = objSlide.Shapes[shpCount]; objSlide.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 100, 100, 100, 80); objShape.TextFrame.TextRange.Text = ds.Tables[0].Rows[i][dc.ColumnName].ToString(); } objPres.SaveAs(strPPTName, PpSaveAsFileType.ppSaveAsPresentation, core.MsoTriState.msoTrue); objPres.Close(); objApp.Quit(); }
sai krishna