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 35 36 37 38 39 40 41 42 43 44
| '
' Déclaration des variables
Dim Forme As PowerPoint.Shape
Dim Diapo As PowerPoint.Slide
Dim strAncien As String
Dim StrNew As String
Dim strNouveau As String
'Boucle sur les Slide de la présentation
For Each Diapo In ActivePresentation.Slides
'Boucle sur les formes
For Each Forme In Diapo.Shapes
'Vérifie s'il s'agit d'un objet lié
If Forme.Type = msoLinkedOLEObject Then
'Vérifie si l'objet lié est un objet tableau excel ou graphique
If (Forme.OLEFormat.ProgID = "Excel.Sheet.8" Or Forme.OLEFormat.ProgID = "Excel.Chart.8") Then
'Modifie la source
strAncien = Forme.LinkFormat.SourceFullName
StrNew = Mid(strAncien, InStrRev(strAncien, "\BDD_août_2012"))
strNouveau = Replace(strAncien, "lyon1", "lyon")
If strAncien <> strNouveau Then
Forme.LinkFormat.SourceFullName = strNouveau
' 'Mise à jour
Forme.LinkFormat.Update
End If
End If
End If
Next
Next
ActivePresentation.Save
End Sub |
Partager