Hi,
I have 3 portions in a paragraph. "A ", "B " and "C ". A is red, B is blue and C is green. This outputs as expected in PPT and PPTX.
When I change the text of the first portion, from "A " to “” (blank / empty) the styles for B and C are no longer applied in PPT, but they work in PPTX.
Thank-you for your time.
IAutoShape shape1 = _presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 20, 20, 100, 50);
shape1.FillFormat.FillType = FillType.Solid;
shape1.FillFormat.SolidFillColor.Color = Color.White;
//
// "A ", "B ", "C "
//
shape1.TextFrame.Paragraphs[0].Portions[0].Text = "A ";
shape1.TextFrame.Paragraphs[0].Portions.Add(new Portion("B "));
shape1.TextFrame.Paragraphs[0].Portions.Add(new Portion("C "));
shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.FillType = FillType.Solid;
shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.SolidFillColor.Color = Color.Red;
shape1.TextFrame.Paragraphs[0].Portions[1].PortionFormat.FillFormat.FillType = FillType.Solid;
shape1.TextFrame.Paragraphs[0].Portions[1].PortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;
shape1.TextFrame.Paragraphs[0].Portions[2].PortionFormat.FillFormat.FillType = FillType.Solid;
shape1.TextFrame.Paragraphs[0].Portions[2].PortionFormat.FillFormat.SolidFillColor.Color = Color.Green;
IAutoShape shape2 = _presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 20, 100, 100, 50);
shape2.FillFormat.FillType = FillType.Solid;
shape2.FillFormat.SolidFillColor.Color = Color.White;
//
// “”, "B ", "C "
//
shape2.TextFrame.Paragraphs[0].Portions[0].Text = “”; // empty / blank
shape2.TextFrame.Paragraphs[0].Portions.Add(new Portion("B "));
shape2.TextFrame.Paragraphs[0].Portions.Add(new Portion("C "));
shape2.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.FillType = FillType.Solid;
shape2.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.SolidFillColor.Color = Color.Red;
shape2.TextFrame.Paragraphs[0].Portions[1].PortionFormat.FillFormat.FillType = FillType.Solid;
shape2.TextFrame.Paragraphs[0].Portions[1].PortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;
shape2.TextFrame.Paragraphs[0].Portions[2].PortionFormat.FillFormat.FillType = FillType.Solid;
shape2.TextFrame.Paragraphs[0].Portions[2].PortionFormat.FillFormat.SolidFillColor.Color = Color.Green;