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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
Option Explicit
Public MatriceShape() As Variant
Sub Essai()
Dim PresentationEncours As Presentation
Dim MaComboBox1 As Object, MaComboBox2 As Object
Dim ContenuCombo1 As Variant
Set PresentationEncours = ActivePresentation
With PresentationEncours
Set MaComboBox1 = .Slides(1).Shapes("ComboBox1").OLEFormat.Object
ContenuCombo1 = Array("Conditionnement", "Fabrication", "Magasin", "Energie", "Infrastructure")
Set MaComboBox2 = .Slides(1).Shapes("ComboBox2").OLEFormat.Object
With MaComboBox1
.Clear
.List = ContenuCombo1
End With
MaComboBox2.Clear
Set MaComboBox1 = Nothing
Set MaComboBox2 = Nothing
End With
Set PresentationEncours = Nothing
End Sub
Sub ChargerLaComboBox2(ByVal NumeroSlide As Integer, ByVal TitreShape As String)
Dim I As Integer
Dim Matable As Table
Dim Continuer As Boolean
Dim IndiceTable As Integer
With ActivePresentation.Slides(NumeroSlide).Shapes
Continuer = False
For I = 1 To .Count
If .Item(I).HasTable Then
Set Matable = ActivePresentation.Slides(NumeroSlide).Shapes(I).Table
If Matable.Cell(1, 1).Shape.TextFrame.TextRange = TitreShape Then
IndiceTable = I
Continuer = True
End If
Set Matable = Nothing
End If
Next I
If Continuer = True Then
Set Matable = ActivePresentation.Slides(NumeroSlide).Shapes(IndiceTable).Table
With Matable
ReDim MatriceShape(Matable.Columns(1).Cells.Count - 2)
For I = 2 To Matable.Columns(1).Cells.Count
MatriceShape(I - 2) = Matable.Cell(I, 1).Shape.TextFrame.TextRange
Next I
End With
Set Matable = Nothing
End If
End With
End Sub |
Partager