Free Support Forum - aspose.com

Keep the sequence of numbered list that has NumberedBulletStartWith

Hi,
In normal scenario, when I’m adding numbered paragraphs without setting ParagraphFormat.Bullet.NumberedBulletStartWith property, there is only one list created with sequential numbers that start from 1.
Something like:

1. Bullet 1
2. Bullet 2
3. Bullet 3

The problem starts when I want to have a numbered list, to count sequentially from another initial number (let’s say 2). For that I have to set ParagraphFormat.Bullet.NumberedBulletStartWith property to 2, but for the next paragraphs I just want to have the next number in the sequence. The same behavior as before. At the end, all paragraphs should belong to the same numbered list. This is after all the common behavior of PowerPoint.
For example I need to have:

2. Bullet 1
3. Bullet 2
4. Bullet 3

instead of :

2. Bullet 1
1. Bullet 2
2. Bullet 3

I have created a test application (55.9 KB) to demonstrate the issue.

Similar issue

Please advice.

Regards,
FB

@fireball4,

I suggest you to please try using following sample code on your end.

using (var presentation = new Presentation("SLIDESNET-41324.pptx"))
{
   var shape = presentation.Slides[0].Shapes.OfType<IAutoShape>().First();

   // First list
   var paragraph1 = new Paragraph { Text = "bullet 2" };
   paragraph1.ParagraphFormat.Bullet.NumberedBulletStartWith = 2;
   paragraph1.ParagraphFormat.Bullet.Type = BulletType.Numbered;
   shape.TextFrame.Paragraphs.Add(paragraph1);

   var paragraph2 = new Paragraph { Text = "bullet 3" };
   paragraph2.ParagraphFormat.Bullet.NumberedBulletStartWith = 3; // ADDED: bullet start with 3 per customer needs
   paragraph2.ParagraphFormat.Bullet.Type = BulletType.Numbered;  // FIXED: paragraph1 local variable type was set instead of paragraph2.
   shape.TextFrame.Paragraphs.Add(paragraph2);

   // Second list
   var paragraph5 = new Paragraph { Text = "bullet 5" };
   paragraph5.ParagraphFormat.Bullet.NumberedBulletStartWith = 5;
   paragraph5.ParagraphFormat.Bullet.Type = BulletType.Numbered;
   shape.TextFrame.Paragraphs.Add(paragraph5);

   presentation.Save("SLIDESNET-41324-slides.pptx", SaveFormat.Pptx);
}

Hello,

Thank you for your quick reply!

As I said, “all paragraphs should belong to the same numbered list”. What you are proposing it will create 3 different lists with correct numbers, but when someone will try to edit them later in PowerPoint, it will see some “strange behavior” like this (8.1 KB)

It seems that every time we use NumberedBulletStartWith, a new list is generated (which sounds normal behavior to me). Is there any other way that I can achieve the required behavior, or is this some bug/new functionality?

Kind regards,
FB

@fireball4,

I have worked over your scenario. An issue with ID SLIDESNET-41551 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Can you please inform me about the status of this?

@fireball4,

I have verified from our issue tracking system and like share that tentative ETA for this issue is in Aspose.Slides for .NET 20.4. We request for your patience and will share feedback with you as soon as it will be addressed.