Do this for each slide you want to change:
ODP.ShapeTree tree = slide.Slide.CommonSlideData.ShapeTree; foreach (ODP.Shape shape in tree.Elements<ODP.Shape>()) { // Run through all the paragraphs in the document foreach (ODD.Paragraph paragraph in shape.Descendants().OfType<ODD.Paragraph>()) { foreach (ODD.Run run in paragraph.Elements<ODD.Run>()) { if (run.Text.InnerText.Contains("PLACEHOLDER")) { run.Text = new ODD.Text("Your new text"); } } } }
Keep in mind that if your template placeholders contain spaces, this can create two separate startup elements. Thus, instead of one run item with run.Text "Place place", you can get one run with run.text "Place" and another one with run.Text "holder".
source share