We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Nested Numbered Lists

Is it possible to nest numbered lists? I can manage to indent the list items I want nested however the item numbering doesn't get reset, the paragraph NumberedBulletStartWith property seems to be getting ignored. See code below, I am using version 5.2.0.0

Aspose.Slides.Presentation pres = new Aspose.Slides.Presentation();
Aspose.Slides.Slide slide = pres.GetSlideByPosition(1);
Aspose.Slides.Rectangle rect = slide.Shapes.AddRectangle(300, 300, 3000, 2000);

Aspose.Slides.TextFrame tFrame = rect.AddTextFrame(String.Empty);
tFrame.Paragraphs.Clear();

Aspose.Slides.Paragraph para = new Aspose.Slides.Paragraph();
tFrame.Paragraphs.Add(para);
para.HasBullet = true;
para.BulletType = Aspose.Slides.BulletType.Numbered;
para.BulletOffset = 40;
para.TextOffset = 25;

Aspose.Slides.Portion port1 = new Aspose.Slides.Portion("List 1\n");
para.Portions.Add(port1);

Aspose.Slides.Portion port2 = new Aspose.Slides.Portion("List 2");
para.Portions.Add(port2);

Aspose.Slides.Paragraph para2 = new Aspose.Slides.Paragraph();
para2.HasBullet = true;
para2.NumberedBulletStartWith = 1;
para2.BulletOffset = 180;
para2.TextOffset = 200;
Aspose.Slides.Portion port21 = new Aspose.Slides.Portion("List 2.1\n");
para2.Portions.Add(port21);
tFrame.Paragraphs.Add(para2);

Aspose.Slides.Portion port22 = new Aspose.Slides.Portion("List 2.2");
para2.Portions.Add(port22);

Aspose.Slides.Paragraph para3 = new Aspose.Slides.Paragraph();
tFrame.Paragraphs.Add(para3);
para3.NumberedBulletStartWith = 3;
para3.HasBullet = true;
para3.BulletType = Aspose.Slides.BulletType.Numbered;
para3.BulletOffset = 40;
para3.TextOffset = 25;
Aspose.Slides.Portion port3 = new Aspose.Slides.Portion("List 3");
para3.Portions.Add(port3);
Aspose.Slides.Presentation pres = new Aspose.Slides.Presentation();
Aspose.Slides.Slide slide = pres.GetSlideByPosition(1);
Aspose.Slides.Rectangle rect = slide.Shapes.AddRectangle(300, 300, 3000, 2000);

Aspose.Slides.TextFrame tFrame = rect.AddTextFrame(String.Empty);
tFrame.Paragraphs.Clear();

Aspose.Slides.Paragraph para = new Aspose.Slides.Paragraph();
tFrame.Paragraphs.Add(para);
para.HasBullet = true;
para.BulletType = Aspose.Slides.BulletType.Numbered;
para.BulletOffset = 40;
para.TextOffset = 25;

Aspose.Slides.Portion port1 = new Aspose.Slides.Portion("List 1\n");
para.Portions.Add(port1);

Aspose.Slides.Portion port2 = new Aspose.Slides.Portion("List 2");
para.Portions.Add(port2);

Aspose.Slides.Paragraph para2 = new Aspose.Slides.Paragraph();
para2.HasBullet = true;
para2.NumberedBulletStartWith = 1;
para2.BulletOffset = 180;
para2.TextOffset = 200;
Aspose.Slides.Portion port21 = new Aspose.Slides.Portion("List 2.1\n");
para2.Portions.Add(port21);
tFrame.Paragraphs.Add(para2);

Aspose.Slides.Portion port22 = new Aspose.Slides.Portion("List 2.2");
para2.Portions.Add(port22);

Aspose.Slides.Paragraph para3 = new Aspose.Slides.Paragraph();
tFrame.Paragraphs.Add(para3);
para3.NumberedBulletStartWith = 3;
para3.HasBullet = true;
para3.BulletType = Aspose.Slides.BulletType.Numbered;
para3.BulletOffset = 40;
para3.TextOffset = 25;
Aspose.Slides.Portion port3 = new Aspose.Slides.Portion("List 3");
para3.Portions.Add(port3);

I've found the answer, the paragraph Depth property. Setting the Depth to 2 on the 2nd paragraph gives me the desired effect.

Hi Dave,

That is really nice that you have been able to figure out the issue with the help of documentation. Please share if you encounter any issue.

Thanks and Regards,