PowerPoint Presentation with Slides and Comments Is Throwing an Exception

we are using slides.net with .net 4.7.2 in windows 10, and we have a pptx with slides with comments and it is throwing an exception.

are there any known issues with comments in slides. deleting the slides with comments solves the crash.

Regards,
Raman

@sraman

It seems you are experiencing an issue with the Aspose.Slides API when handling PowerPoint presentations that contain comments. While I don’t have specific information about known issues related to comments in slides, I can suggest a workaround based on your observation that deleting the slides with comments resolves the crash.

If you need to access comments in your slides without causing the API to crash, you might consider using a code snippet to safely iterate through the comments and handle them appropriately. Here’s an example of how you can access slide comments in a presentation:

using System;
using Aspose.Slides;

namespace AccessSlideComments
{
    class Program
    {
        public static void Main()
        {
            // Path to the presentation file
            string dataDir = "path_to_your_presentation.pptx";

            // Instantiate Presentation class
            using (Presentation presentation = new Presentation(dataDir))
            {
                foreach (var commentAuthor in presentation.CommentAuthors)
                {
                    var author = (CommentAuthor)commentAuthor;
                    foreach (var comment in author.Comments)
                    {
                        Console.WriteLine($"ISlide: {comment.Slide.SlideNumber} has comment: {comment.Text} with Author: {comment.Author.Name} posted on time: {comment.CreatedTime}");
                    }
                }
            }
        }
    }
}

This code will allow you to access and print out the comments without modifying the slides. If the issue persists, consider reaching out to Aspose support for further assistance or checking for updates to the API that may address this problem.

If you have any additional details about the exception being thrown, sharing that information could help in diagnosing the issue further.

Sources:
[1]: AccessSlideComments.cs

@sraman,
We are sorry that you have to encounter this problem. Please share the following files and information:

  • sample presentation file
  • code example to reproduce the exception
  • stack trace of the error
  • Aspose.Slides version you used

This will help us to investigate the issue and fix the error.