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
| 'boucle sur les objets de la feuille
Public Function BoucleImagesFeuille(s_NomFeuille As String, i_Colonne As Integer) As Integer
Dim Obj As Shape
Dim i_Iteration As Integer
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("DonneesFeuille").Cells.Columns(i_Colonne).ClearContents
'Compte le nombre de formes dans la feuille
Sheets("DonneesFeuille").Cells(1, i_Colonne + 1).Value = Worksheets(s_NomFeuille).Shapes.Count
'Boucle sur les formes contenues dans la feuille
i_Iteration = 0
For Each Obj In Worksheets(s_NomFeuille).Shapes
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.Name
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.Height
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.Width
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.Top
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.Left
'là je sais que c'est un objet groupé mais je n'ai pas accès aux "zone text"
If InStr(Obj.Name, "Text Box") >= 1 Or InStr(Obj.Name, "Group") >= 1 Then
i_Iteration = i_Iteration + 1
Sheets("DonneesFeuille").Cells(i_Iteration, i_Colonne).Value = Obj.AlternativeText
End If
Application.ScreenUpdating = True
Next Obj
Application.ScreenUpdating = True
BoucleImagesFeuille = 1
End Function |
Partager