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
|
Sub texteppt()
'déclaration des variables
Dim xlSheet As Excel.Worksheet
Dim shpTexte As Shape
Dim PPT As PowerPoint.Application
Dim PptDoc As PowerPoint.Presentation
Set PPT = CreateObject("Powerpoint.Application") 'creation session PowerPoint
PPT.Visible = True
Set PptDoc = PPT.Presentations.Open("LIEN SOURCE.pptx") 'ouverture fichier ppt
'ouverture du fichier Excel
Set xlSheet = Sheets("ppt")
' on crée une zone de texte
Set shpTexte = ActivePresentation.Slides(4).Shapes.AddTextbox(msoTextOrientationHorizontal, 50, 50, 200, 50)
With shpTexte.TextFrame.TextRange
.Font.Bold = msoTrue
.Font.Size = 20
.Text = xlSheet.Range("B2").Value
End With
End Sub |
Partager