to zrobić dla każdego slajdu, chcesz zmienić:
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");
}
}
}
}
Należy pamiętać, że jeśli elementy zastępcze twojego szablonu zawierają spacje, może to spowodować utworzenie dwóch pojedynczych elementów. Zamiast jednego elementu run z run.Text "Place holder", możesz uzyskać jeden przebieg z run.text "Place" i inny z run.Text "holder".
Czy to działa? Czy jesteś w stanie opublikować rozwiązanie? –