'Continue bulleted numbering from previous slide

I'm trying to write a routine to enable me to continue numbering including style from the previous slide. I got half way there and got stuck.

First thing is I'm always getting the same bullet.type regardless of the style that is applied on the previous slide.

Secondly, I can't figure out to identify the last numbered line and its bullet style on the previous slide. I wrote some pseudocode and left it at that as I tried to get working but was stuck at the previous post. I would need help on how to test if a line is bulleted and what type of bullet and style it is.

Code follows.

Thanks in advance.

Sub ContinueNumbering()
Dim oSlide As slide
Dim oShape As Shape
Dim PreviousBulletType As Long
Dim i As Single

'on err goto err_handler
If ActiveWindow.Selection.Type = ppSelectionNone Then GoTo err_handler
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then GoTo err_handler

Set oShape = ActiveWindow.Selection.ShapeRange(1)
Set oSlide = Application.ActiveWindow.View.slide

If oSlide.SlideIndex = 1 Then
   MsgBox "No previous slide.", vbCritical, "Error"
   Exit Sub
End If

With ActivePresentation.Slides(oSlide.SlideIndex - 1).Shapes(oShape.Name)
   With .textFrame.textRange.ParagraphFormat
      PreviousBulletType = .bullet.Type
      MsgBox .bullet.Type
   End With
End With


'' //////////////////////////////////////
'' Pseudo code from here on
''///////////////////////////////////////

'' For...next lines in previous slide
'' test if bulleted or numbered
'' if first line with bullet found is numbered
'' count the number of numbers
'' style to apply = bullet style of last shape on previous slide
''
'' apply bullet style to selected shape, textbox or placeholder
''

With ActiveWindow.Selection.ShapeRange(1)

    With .textFrame.textRange.ParagraphFormat.bullet

        .Type = ppBulletNumbered

        .StartValue = UserInput
        
      End With
   End With


Exit Sub

err_handler:
MsgBox "Please select a single shape.", vbCritical, "Error"
On Error Resume Next

End Sub


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source