1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Dim Sld As Slide
Dim current_name As String
Dim new_slide_name As String
On Error GoTo Err_end
Set Sld = ActiveWindow.View.Slide
'Routine was developed to change only the name of the current slidewhichever slide is visible in the user interface.
'This routine leaves out the looping portion and works with just a single slide.
'This routine is useful for cases in which only one slide needs to have its name changed.
If MsgBox("Si vous modifiez le nom de la diapositive active, vos macros risquent de ne plus fonctionner", vbOKCancel, "Attention") = 2 Then GoTo Err_end
' get the current name
current_name = Sld.Name
' prompt for a new slide name
new_slide_name = InputBox$("The current slide name is " _
& current_name, "Change Slide Name?")
' remove any leading/trailing spaces
new_slide_name = Trim(new_slide_name)
' if the length is > 0, then change the slide name
If Len(new_slide_name) > 0 Then
Sld.Name = new_slide_name
End If
Exit Sub
Err_end:
If Err <> 0 Then MsgBox Err.Description
End Sub |
Partager