I have attached my desired output file.
the code below is for Version 5.4 but it fails for higher version of Dlls. I tried with 6.1 and 6.5 and it fails. Error is Index is out of Range.
private void CreateMoreCommentsSlide(int styp, string seqno)
{
ShapeEx moreShp = _moreSlide.Shapes[0]; //comments
ShapeEx seqnoShp = _moreSlide.Shapes[2]; //seqno
if (seqno != null && seqnoShp.AlternativeText == "Seqno")
((AutoShapeEx)seqnoShp).TextFrame.Text = seqno;
StringBuilder moreText = new StringBuilder();
var moreCommentsList = _dictMoreComments.OrderBy(x => x.Key).ToList();
foreach (KeyValuePair ky in moreCommentsList)
{
moreText.AppendLine(GetQuestionText(ky.Key, styp));
moreText.AppendLine(ky.Value);
}
//change font color of Question and answers
TextFrameEx textFrame1 = ((AutoShapeEx)moreShp).TextFrame;
textFrame1.Text = moreText.ToString();
ParagraphEx para1 = textFrame1.Paragraphs[2];
PortionEx potion1 = para1.Portions[0];
potion1.FillFormat.FillType = FillTypeEx.Solid;
potion1.FillFormat.SolidFillColor.Color = Color.White;
ParagraphEx para2 = null;
ParagraphEx para3 = null;
ParagraphEx para4 = null;
if (_dictMoreComments.Count > 1)
{
para2 = textFrame1.Paragraphs[6];
PortionEx potion2 = para2.Portions[0];
potion2.FillFormat.FillType = FillTypeEx.Solid;
potion2.FillFormat.SolidFillColor.Color = Color.White;
}
if (_dictMoreComments.Count > 2)
{
para3 = textFrame1.Paragraphs[10];
PortionEx potion3 = para3.Portions[0];
potion3.FillFormat.FillType = FillTypeEx.Solid;
potion3.FillFormat.SolidFillColor.Color = Color.White;
}
if (_dictMoreComments.Count > 3)
{
para4 = textFrame1.Paragraphs[14];
PortionEx potion4 = para4.Portions[0];
potion4.FillFormat.FillType = FillTypeEx.Solid;
potion4.FillFormat.SolidFillColor.Color = Color.White;
}
_dictMoreComments.Clear();
moreCommentsList.Clear();
_isMoreComments = true;
}