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

Free Support Forum - aspose.com

Portions not deleting

Hi There

I’m trying to delete the text from portions in paragraphs, by calling the Paragraph.Portions.Clear() method.
It seems to work as the list of portions gets blamked in my debugger window, but when I try and save the document, the filesize increases, but the content appears identical to the way it was before I wiped all the portions. I’m just wondering what I might be doing wrong…

Cheers

Eric

Hello Eric,

Could you please provide example of presentation and code you use to change the text.

Also I’d not suggest to remove all paragraphs and portions from a text frame. Correct text frame must have at least 1 paragraph, 1 portion with at least one character (for example space). Otherwise created presentation sometimes can’t be opened by MS PowerPoint.

Hi Alexey

Apologies, it was my own fault. I have changed my approach to replace portions with new text rather than clearing them, as per your suggestion :slight_smile:

Thanks

Eric

I too wanted to do this. I'm probably going to clear out my template and won't have to do this but I may not have that option in the future. For what is worth this seems to work. Without the second line the paragraph does not have a portion and will fail when trying to open the resultant file.

slides[9].FindShape("FundedTest").TextFrame.Paragraphs[0].Portions.Clear();
slides[9].FindShape("FundedTest").TextFrame.Paragraphs[0].Portions.Add(new Portion("x"));

Hi,

I have tried to remove all the portions from the text frame Paragraph[0] and yet I have no problem in opening presentation. If the presentation has only one paragraph and only one portion even and you remove that as well. Still you will be able to access the presentation as PowerPoint 2007 automatically adds a default paragraph with one portion. If you still feel any query, then please share some more details about what actually you need Aspose.Slides for .NET to offer you. We will be happy to resolve your problem.

Thanks and Regards,