Hello Spire.Presentation friends!
Is it possible to write a variable to an existing textbox in a presentation slide?
For example, read a textbox names CustomerName and update it with a value from a form.
Thank you so much for your help!
Presentation templatePresentation = new Presentation();
templatePresentation.LoadFromFile("hello.pptx");
var slide = templatePresentation.Slides[0];
foreach(IShape shape in slide.Shapes)
{
if (shape.Name.Equals("CustomerName"))
{
if (shape.IsTextBox)
{
IAutoShape autoShape = shape as IAutoShape;
autoShape.TextFrame.Paragraphs[0].Text = "Updated String";
}
}
}
templatePresentation.SaveToFile("Test.pptx", Spire.Presentation.FileFormat.Pptx2013);