Hi,
We are using Aspose Slides .net 14.5.0 dll for building powerpoint(ppt/pptx). We are getting below error while trying to apply master template.
"Error removing layout slide: this layout slide is used in presentation." This error is occuring for both ppt and pptx. Also its replicable in .Net14.4.0 version as well.
Below is the code snippet where the exception was thrown
Presentation m_masterTemplate = new Presentation();
if (m_masterTemplate != null)
{
ISlide cloneSlide = m_show.Slides.AddClone(m_masterTemplate.Slides[0]);
IMasterSlide logoMaster = m_show.Slides[cloneSlide.SlideNumber - 1].LayoutSlide.MasterSlide;
foreach (ISlide slides in m_show.Slides)//AWQC-595 - Updated to Islide
{
slides.LayoutSlide.MasterSlide = logoMaster; // Exception occured in this line
}
m_show.Slides.Remove(m_show.Slides[cloneSlide.SlideNumber - 1]);
m_show.Masters.RemoveUnused(true);
}
I am attaching the poc and master template used. It would be grateful if u can guide us resolving this issue as soon as possible.
Thanks,
Divya