Namespaces needed
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Microsoft.Office.Core;
namespace WindowsFormsApplication8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
================================================================
PowerPoint._Application ppApp;// a powerpoint applin
PowerPoint.Presentation ppMP;///a powerpoint presentation
ppApp = new PowerPoint.Application();////opening a powerpoint applin
Microsoft.Office.Core.MsoTriState ofalse = Microsoft.Office.Core.MsoTriState.msoFalse;
Microsoft.Office.Core.MsoTriState otrue = Microsoft.Office.Core.MsoTriState.msoTrue;
ppApp.Visible = otrue;
ppApp.Activate();
================================================================
//saving it
ppMP = ppApp.Presentations.Open(@"C:\Users\snair02\Desktop\SRJ DOCS\raj.pptx",ofalse,ofalse,otrue);
PowerPoint.Slides oSlides = ppMP.Slides;
foreach (PowerPoint.Slide oSlide in oSlides)
{
foreach (PowerPoint.Shape shape in oSlide.Shapes)
{
shape.TextFrame.TextRange.Text = shape.TextFrame.TextRange.Text.Replace("*", "Hi I am Sreeraj");
}
}
}
}
}