Free Support Forum - aspose.com

currPres.CloneSlide DROPPING NOTES!

Hi There.

I using CloneSlide to copy slides from one presentation to another, and the notes are being dropped from the slides. Anyone have a quick fix ?....Wondering how a bug like this is even present really...

currPres.CloneSlide(currPres.GetSlideByPosition(slideNum),i+1, newPres, new SortedList());

...the slides in the newPres have no notes !!!

Thanx,

Barry

Nortel

CloneSlide function doesn’t check Notes. You have to copy it separately.
TextDemo contains commented demo code for that. That is simple enough.
Just create Notes in the cloned slide and copy all paragraphs.

if (srcSlide.Notes != null)
{
clonedSlide.AddNotes();
for (int j = 0; j < srcSlide.Notes.Paragraphs.Count; j++)
{
clonedSlide.Notes.Paragraphs.Add(new Paragraph(srcSlide.Notes.Paragraphs[ j ]));
}
clonedSlide.Notes.Paragraphs.RemoveAt(0);
}

Slide srcSlide, newSlide;
.

. (get a slide from the srcPP)

'

if(srcSlide.Notes.Text != ""){

newSlide.AddNotes();

for (int j = 0; j < srcSlide.Notes.Paragraphs.Count; j++) {
newSlide.Notes.Paragraphs.Add(new Paragraph(srcSlide.Notes.Paragraphs[j]));
}

newSlide.Notes.Paragraphs.RemoveAt(0);

//DisplayStatus("New Slide Notes: " + newSlide.Notes.Text);

}

newPres.AddBodySlide(); //Add new slide to new Presentation...

// remove dummy slide
newPres.Slides.Remove(newPres.GetSlideByPosition(newPres.Slides.LastSlidePosition));