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

Free Support Forum - aspose.com

How to simulate nested Lists?

I hope you are doing well!!

I am actually trying to create a nested list using code similar to one we can create manually.

I have attached two presentations: Pres-Manual and Pres-Code. I am trying to create to create the nested list in Pres-Manual using the code.
While I am able to create a similar nested list using code, I was unable to navigate the cursor to the outer list when I press (Shift+Tab) while the cursor is on a new element of the inner list.

In the image shown, when I press Shift+Tab in Pres-Manual, it creates a new item in the List First,Second,…
create-third.PNG (3.2 KB)

I am unable to do this in Pres-Code. Would it be possible for you to please tell me what changes need to made in the code to achieve this behavior? Presentations.zip (98.2 KB)

The code that I used to generate this Pres-Code presentation is :

Paragraph firstPoint = new Paragraph();
firstPoint.ParagraphFormat.Bullet.Type = BulletType.Symbol;
firstPoint.ParagraphFormat.MarginLeft = 30.0f;
firstPoint.Text = “first”;

        Paragraph secondPoint = new Paragraph();
        secondPoint.ParagraphFormat.Bullet.Type = BulletType.Symbol;
        secondPoint.ParagraphFormat.MarginLeft = 30.0f;
        secondPoint.Text = "second";

        Paragraph nestedFirstPoint = new Paragraph();
        nestedFirstPoint.ParagraphFormat.Bullet.Type = BulletType.Symbol;
        nestedFirstPoint.ParagraphFormat.MarginLeft = 60.0f;
        nestedFirstPoint.Text = "nested first";

        Paragraph nestedSecondPoint = new Paragraph();
        nestedSecondPoint.ParagraphFormat.Bullet.Type = BulletType.Symbol;
        nestedSecondPoint.ParagraphFormat.MarginLeft = 60.0f;
        nestedSecondPoint.Text = "nested second";



I have observed the requirements shared by you and suggest you to please visit documentation article, Managing paragraph indent for indented paragraph bullets. I hope the shared information will be helpful.

1 Like

Thank you for the reference, it helped me.

However, I am still facing a problem: For a particular paragraph, depth seems to not work when MarginLeft is set. Is there a way to use both LeftMargin and Depth?


It is good to know the suggestions worked on your end. For your further problem, can you please share the desired output presentation and what you are getting using Aspose.Slides. Please also share the working sample code as well for testing on our end.