Slide ID is the way to go but just a comment The SlideID refers to the order the slides were added so you may need to read the slideID first. It will not easily change.
Sub show_ID()Dim osld As Slide
For Each osld In ActivePresentation.Slides
With osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 100, 20)
.Name = "ID"
.TextFrame.TextRange = osld.SlideID
End With
Next osld
End Sub
Sub kill_IDAgain()
On Error Resume Next
Dim osld As Slide
For Each osld In ActivePresentation.Slides
osld.Shapes("ID").Delete
Next osld
End Sub