- Code: Select all
public void CreatePPTFromHtml(string htmlString, string outputFilename)
{
Presentation ppt = new Presentation();
ShapeList shapes = ppt.Slides[0].Shapes;
try
{
[color=#FF0000] shapes.AddFromHtml(htmlString);[/color]
}
catch (Exception ex)
{
throw ex;
}
ppt.SaveToFile(outputFilename, FileFormat.Pptx2013);
}
Find the details of the exception:
Exception message:
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
Stack Trace:
at System.Collections.ArrayList.get_Item(Int32 index)
at spr䚸.ᜀ(Int32 A_0, String A_1, Dictionary`2 A_2)
at spr䚷.ᜂ(ArrayList A_0, Char[] A_1)
at EmbedHtmlString.AppendHtmlString.CreatePPTFromHtml(String htmlString, String outputFilename) in line 8
Any insight on why this error is coming. Thanks in advance.