Hi Team,
Using the below sample code, I have created a presentation for Managing Paragraph Bullets in PPTX.
When i open pptx, it prompts to repair the presentation with following message:
"Powerpoint found a problem with content in :…pptx.Powerpoint can attempt to repair the presentation.
Powerpoint couldn’t read some content in Bullet."
I am using 14.9.0.0 version of Aspose.slides for .Net and opening presentation in PowerPoint 2013.
I have zipped up and attached the presentation.
Code:
//Creating a presenation instance
using (Presentation pres = new Presentation())
{<span class="code-comment">//Accessing the first slide
ISlide slide = pres.Slides[0];
<span class="code-comment">//Adding and accessing Autoshape
IAutoShape aShp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 400, 200);
<span class="code-comment">//Accessing the text frame of created autoshape
ITextFrame txtFrm = aShp.TextFrame;
<span class="code-comment">//Removing the <span class="code-keyword">default</span> exisiting paragraph
txtFrm.Paragraphs.RemoveAt(0);
<span class="code-comment">//Creating a paragraph
Paragraph para = new Paragraph();
<span class="code-comment">//Setting paragraph bullet style and symbol
para.ParagraphFormat.Bullet.Type = BulletType.Symbol;
para.ParagraphFormat.Bullet.Char = Convert.ToChar(8226);<span class="code-comment">//Setting paragraph text
para.Text = “Welcome to Aspose.Slides”;
<span class="code-comment">//Setting bullet indent
para.ParagraphFormat.Indent = 25;
<span class="code-comment">//Setting bullet color
para.ParagraphFormat.Bullet.Color.ColorType = ColorType.RGB;
para.ParagraphFormat.Bullet.Color.Color = Color.Black;
para.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; // set IsBulletHardColor to true to use own bullet color
//Setting Bullet Height
para.ParagraphFormat.Bullet.Height = 100;<span class="code-comment">//Adding Paragraph to text frame
txtFrm.Paragraphs.Add(para);
<span class="code-comment">//Creating second paragraph
Paragraph para2 = new Paragraph();
<span class="code-comment">//Setting paragraph bullet type and style
para2.ParagraphFormat.Bullet.Type = BulletType.Numbered;
para2.ParagraphFormat.Bullet.NumberedBulletStyle = NumberedBulletStyle.BulletCircleNumWDBlackPlain;<span class="code-comment">//Adding paragraph text
para2.Text = “This is numbered bullet”;
<span class="code-comment">//Setting bullet indent
para2.ParagraphFormat.Indent = 25;
//Setting Bullet Height para2.ParagraphFormat.Bullet.Height = 100;para2.ParagraphFormat.Bullet.Color.ColorType = ColorType.RGB; para2.ParagraphFormat.Bullet.Color.Color = Color.Black; para2.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; <span class="code-comment">// set IsBulletHardColor to <span class="code-keyword">true</span> to use own bullet color
<span class="code-comment">//Adding Paragraph to text frame
txtFrm.Paragraphs.Add(para2);
<span class="code-comment">//Writing the presentation as a PPTX file
pres.Save(“Bullet.pptx”, SaveFormat.Pptx);
}