Removing Comments from a PowerPoint Presentation in Java Doesn't Work

Hi @stanislav.miroshnichenko1

v21.12 doesn’t provide me enough information. Can you be specific ? Which month this specific feature will be out? Is it in December 2021?

Thanks

@suming.li,
Yes, Aspose.Slides 21.12 will be released in December 2021.

@Andrey_Potapov Any update on this request? It’s been pending for long time.

@suming.li,
I’ve requested news or plans on this issue from our development team again. We will let you know as soon as possible.

@suming.li,
Support for modern comments has been implemented, but we found some issues with removing comments. The tentative ETA is 22.3.

@suming.li,
Our development team investigated the issue. You should not remove comments while enumerating them. Please try using the following code example:

Presentation presentation = new Presentation("CommentsTest.pptx");
try {
    for (ICommentAuthor commentAuthor : presentation.getCommentAuthors()) {
        ICommentAuthor author = commentAuthor;

        System.out.println(author.getName());

        for (IComment comment : author.getComments()) {
            System.out.println("ISlide :" + comment.getSlide().getSlideNumber() + " has comment: "
                    + comment.getText() + " with Author: " + comment.getAuthor().getName() + " posted on time :"
                    + comment.getCreatedTime() + "\n");
        }

        while (author.getComments().size() > 0)
        {
            author.getComments().get_Item(0).remove();
        }
    }

    presentation.save("CommentsTest-Output.pptx", SaveFormat.Pptx);
} finally {
    if (presentation != null)
        presentation.dispose();
}

Documents: Presentation Comments
API Reference: ICommentAuthor Interface | IComment Interface

Hi Andrey,

We tried with the recommended approach above, but that doesn’t seem to be picking up the comment authors. Rather, that picks-up the document original author and look for any comments made by only them.
We would instead like to remove all the comments from slides irrespective of who made that originally.

We have been waiting on this feature for long. Any expedited response on this particular issue would be really appreciated.

Thank you!

@suming.li,
Any comment belongs to some author. You can delete all comments for each author and then delete all authors. The following code snippet shows you how to do this:

for (var author : presentation.getCommentAuthors()) {
    author.getComments().clear();
}

presentation.getCommentAuthors().clear();

API Reference: ICommentAuthorCollection interface | ICommentCollection interface

2 posts were split to a new topic: Removing Comments from a Presentation Throws PptxReadException