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…
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.
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
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.
I have tried to remove all the portions from the text frame Paragraph 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,