We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to access/work with table placeholder

Hi,
Attached is the template, using that I am creating a presentation. In the template, there is only one layout, using that i am creating a slide. In the template I have added a table placeholder which i am not able to access while iterating through all shapes of the slide.

Code:

string template = ConfigurationManager.AppSettings[“TemplateFilePath”];
Presentation pres = new Presentation(MapPath(".") + “\Templates\Presentation1_Template.pptx”);
ILayoutSlide lsTitleAndContent = pres.LayoutSlides[0];
ISlide sld = pres.Slides.AddEmptySlide(lsTitleAndContent);

//Iterate through shapes to find the placeholder
foreach (IShape shp in sld.Shapes)
{
if (shp.Placeholder != null)
{
if (shp is ITable)
{
ITable tbl = (ITable)shp;
//Set the text of the first column of second row
tbl[0, 1].TextFrame.Text = “New”;
}
}
}

//Save presentation with chart
pres.Save(System.Web.HttpContext.Current.Server.MapPath(template) + “TablePlaceHolder.pptx”, SaveFormat.Pptx);

Hi Pradeep,

Thank you for sharing the template file and sample code.

I am able to reproduce your mentioned after an initial test. Your issue has been registered in our issue tracking system with issue id: SLIDESNET-35981. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,