Hi Peter,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your interest in Aspose.Slides.
Please use following code snippet to add text to a Text Frame.
try{
//Instantiate PresentationEx class that represents PPTX
PresentationEx pres = new PresentationEx("d:\\ppt\\example.pptx");
SlideEx coverSlide = pres.getSlides().get(0);
//Printing the total number of slides in the presentation
System.out.println(pres.getSlides().size());
//Fetcching all slide shapes
ShapesEx coverShapes = coverSlide.getShapes();
//Creating an auto shape
int shapeIndex = coverShapes.addAutoShape(ShapeTypeEx.RECTANGLE, 100, 200, 66, 64);
//Getting generated autoshape
AutoShapeEx ase = (AutoShapeEx)coverShapes.get(shapeIndex);
ase.getFillFormat().setFillType(FillTypeEx.NOFILL);
//Getting a text frame inside shape
com.aspose.slides.pptx.TextFrameEx tx=ase.getTextFrame();
//Accessing default paragraph and portion in text frame to add text.
tx.getParagraphs().get(0).getPortions().get(0).setText("Sample Text Here Sample Text Here Sample Text Here ");
//Writing to presentation
pres.write(new FileOutputStream("D:/ppt/ example.ppt") );
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
Thanks and Regards,