Fetching "Start At" Values for Numbered Lists from PPTX in C++

Hi Team,
get_NumberedBulletStartWith() → Returns or sets the first number which is used for group of numbered bullets with no inheritance.
So, for a group starting with 5, then continuing with 6,7,8; get_NumberedBulletStartWith() will always return 5.
Is there a way to get the startsWith number for each bullet point that we see in the Bullet Panel?
Screenshot 2026-01-22 at 1.59.38 PM.jpg (135.1 KB)

Check the mouse pointer at startsAt property which says 6. This 6 needs to be retrieved instead of saying 5 (start of group is 5). So get_NumberedBulletStartWith is always returning 5.

Check the attached PPT.
NestedBulletIssue.pptx.zip (34.0 KB)

Please update on this - On priority.

int16_t startNumberEffective = paragraphFormat->get_Bullet()->get_NumberedBulletStartWith();

where paragraphFormat is IParagraphFormatEffectiveData

@pankajku

You are trying to retrieve the actual display number for each bullet point (as shown in the PowerPoint bullet panel, e.g., 6) rather than the group start number returned by get_NumberedBulletStartWith() .

Unfortunately, Aspose.Slides for C++ does not provide a direct API to fetch the effective starting number for each individual bullet point as displayed in the bullet panel . The method get_NumberedBulletStartWith() only returns the initial number of the bullet group, not the number assigned to each specific bullet in the sequence .

If you need this functionality, you may have to manually calculate or track the numbering based on the structure of the paragraphs and their bullet properties. A support engineer will follow up in this thread if needed.

@pankajku,
Thank you for contacting free support.

Please note that in the PowerPoint document the “Start at” setting is the same for each paragraph in the numbered list:

That is why Aspose.Slides returns the starting number of 5 for each paragraph.

To reflect PowerPoint’s behavior in the Bullets and Numbering dialog, you should implement your own function.

Please try using the following code:

int GetPowerPointParagraphStartAt(
    const SharedPtr<IParagraph>& targetParagraph,
    const SharedPtr<IParagraphCollection>& allParagraphs)
{
    auto targetEff = targetParagraph->get_ParagraphFormat()->GetEffective();
    if (targetEff->get_Bullet()->get_Type() != BulletType::Numbered)
        return 0;

    auto targetDepth = targetEff->get_Depth();

    // Find the index of the target paragraph within the collection.
    int targetIndex = -1;
    for (int i = 0; i < allParagraphs->get_Count(); i++)
    {
        if (System::ObjectExt::Equals(allParagraphs->idx_get(i), targetParagraph))
        {
            targetIndex = i;
            break;
        }
    }
    if (targetIndex < 0)
        return 0;

    auto IsNumberedAtSameDepth = [&](int i) -> bool
        {
            auto eff = allParagraphs->idx_get(i)->get_ParagraphFormat()->GetEffective();
            return eff->get_Bullet()->get_Type() == BulletType::Numbered
                && eff->get_Depth() == targetDepth;
        };

    auto GetStartAtEffective = [&](int i) -> int
        {
            return allParagraphs->idx_get(i)->get_ParagraphFormat()->GetEffective()
                ->get_Bullet()->get_NumberedBulletStartWith();
        };

    // Find the start of the current numbering run for the same list level.
    // Treat a run boundary as one of the following:
    // - The previous paragraph is not numbered at the same depth.
    // - The effective startAt differs from the previous paragraph at the same depth (restart case).
    int runStart = targetIndex;
    for (int i = targetIndex; i > 0; --i)
    {
        if (!IsNumberedAtSameDepth(i) || !IsNumberedAtSameDepth(i - 1))
            break;

        auto curStart = GetStartAtEffective(i);
        auto prevStart = GetStartAtEffective(i - 1);

        if (curStart != prevStart)
            break;

        runStart = i - 1;
    }

    // Use the first paragraph of the run as the numbering base.
    auto base = GetStartAtEffective(runStart);

    // Count how many numbered paragraphs at the same depth appear from runStart to targetIndex.
    int offset = 0;
    for (int i = runStart; i <= targetIndex; i++)
    {
        if (IsNumberedAtSameDepth(i))
            offset++;
    }

    // Return the current paragraph number as shown in PowerPoint's "Bullets and Numbering" dialog.
    return base + offset - 1;
}

The following code uses the function above to print the starting numbers of all paragraphs.

auto presentation = MakeObject<Presentation>(u"ibm (1) copy.pptx");
auto slide = presentation->get_Slide(0);
auto textBox = ExplicitCast<IAutoShape>(slide->get_Shape(0));
auto paragraphs = textBox->get_TextFrame()->get_Paragraphs();

for (auto i = 0; i < paragraphs->get_Count(); i++)
{
    auto paragraph = paragraphs->idx_get(i);
    auto startAt = GetPowerPointParagraphStartAt(paragraph, paragraphs);

    Console::WriteLine(startAt);
}

presentation->Dispose();

Output:

5
6
7

PowerPoint’s behavior in the Bullets and Numbering dialog → This information in the dialog “startsAt” this is not stored in powerpoint xml?
For example → bulletHardColor is set for bullet colors set from Bullets and Numbering dialog.
In similar way, cant we get the startsAt field value from Bullets and Numbering dialog ?
@andrey.potapov

@pankajku,
The “Start at” setting in the Bullets and Numbering dialog is not stored in the presentation file. It depends on the paragraph where the caret is set in the PowerPoint UI. Therefore, Aspose.Slides cannot retrieve it.

@andrey.potapov
Check the second slide in the attached PPT. If there is a bullet point with no text(in between 2 bullet points), the code you provided returns 1, 1, 1; it should return 1, 2, 3.
Any ideas on how to resolve this?

@pankajku,
Yes, you are right. Additionally, the method get_NumberedBulletStartWith returns 1 for each paragraph. It hapens, because the attribute startAt in the list items is not specified in the document, and Aspose.Slides returns the default value (1), but the Bullets and Numbering dialog shows the values correctly.

We have opened the following new ticket(s) in our internal issue tracking system and will investigate the case according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESCPP-4101

@andrey.potapov Can you give us a ETA for this issue SLIDESCPP-4101, so that we can update our timelines accordingly?

@pankajku,
The issue is still open. I don’t have any additional information yet. Unfortunately, I cannot provide a timeline for resolving it. Our developers will do their best to resolve the issue ASAP. We will keep you updated.

@pankajku,
Thank you for your patience.

Please try using the corrected method:

int32_t GetPowerPointParagraphStartAt(System::SharedPtr<IParagraph> targetParagraph, System::SharedPtr<IParagraphCollection> allParagraphs)
{
    auto targetEff = targetParagraph->get_ParagraphFormat()->GetEffective();
    if (targetEff->get_Bullet()->get_Type() != BulletType::Numbered)
        return 0;

    auto targetDepth = targetEff->get_Depth();

    int32_t targetIndex = -1;
    for (int32_t i = 0; i < allParagraphs->get_Count(); i++)
    {
        if (allParagraphs->idx_get(i) == targetParagraph)
        {
            targetIndex = i;
            break;
        }
    }

    if (targetIndex < 0)
        return 0;

    auto IsNumberedAtSameDepth = [&](int32_t i) -> bool
    {
        auto eff = allParagraphs->idx_get(i)
            ->get_ParagraphFormat()
            ->GetEffective();

        return eff->get_Bullet()->get_Type() == BulletType::Numbered
               && eff->get_Depth() == targetDepth;
    };

    auto GetStartAtEffective = [&](int32_t i) -> int32_t
    {
        return allParagraphs->idx_get(i)
            ->get_ParagraphFormat()
            ->GetEffective()
            ->get_Bullet()
            ->get_NumberedBulletStartWith();
    };

    int32_t runStart = targetIndex;
    auto targetStart = GetStartAtEffective(targetIndex);
    for (int32_t i = targetIndex - 1; i >= 0; i--)
    {
        auto curFormat = allParagraphs->idx_get(i)->get_ParagraphFormat()->GetEffective();

        // Skip if this paragraph is not the same depth.
        if (curFormat->get_Depth() != targetDepth)
            continue;

        // Break the numbering chain if this paragraph is the same depth but with a different bullet type.
        if (curFormat->get_Bullet()->get_Type() != BulletType::Numbered)
            break;

        if (GetStartAtEffective(i) != targetStart)
            break;

        runStart = i;
    }

    // Use the first paragraph of the run as the numbering base.
    auto begin = GetStartAtEffective(runStart);

    // Count how many numbered paragraphs at the same depth appear from runStart to targetIndex.
    int32_t offset = 0;
    for (int32_t i = runStart; i <= targetIndex; i++)
    {
        if (!IsNumberedAtSameDepth(i))
            continue;

        offset++;
    }

    // Return the current paragraph number as shown in PowerPoint's "Bullets and Numbering" dialog.
    return begin + offset - 1;
}

You can also use the IBulletFormatEffectiveData::get_ActualBulletValue method, which returns the actual bullet value:

auto pres = System::MakeObject<Presentation>(u"NestedBulletIssue.pptx");

auto slide = pres->get_Slide(1);
auto textBox = System::ExplicitCast<IAutoShape>(slide->get_Shape(1));
auto paragraphs = textBox->get_TextFrame()->get_Paragraphs();

for (int32_t i = 0; i < paragraphs->get_Count(); i++)
{
    auto paragraph = paragraphs->idx_get(i);
    auto bulletEffective = paragraph->get_ParagraphFormat()->GetEffective()->get_Bullet();
    Console::WriteLine(u"ActualBulletValue:  " + bulletEffective->get_ActualBulletValue() + u";\tPowerPoint StartAt: " + GetPowerPointParagraphStartAt(paragraph, paragraphs));
}

pres->Dispose();