commit 3d0e3306c96b5d710d2f7d8b67b7b309b8f20ab9 Author: William Lonfat Date: Sun Jan 5 17:59:42 2025 +0100 Téléverser les fichiers vers "/" Les fichiers ici présents ont été réalisés pour faire une barre de progression sur PowerPoint adaptée au nombre de diapositives. diff --git a/Barre-de-progression.bas b/Barre-de-progression.bas new file mode 100644 index 0000000..b035556 --- /dev/null +++ b/Barre-de-progression.bas @@ -0,0 +1,17 @@ +Attribute VB_Name = "Module1" +Sub AjouterBarreDeProgression() + Dim sld As Slide, shp As Shape + Dim totalSlides As Integer, currentSlideIndex As Integer, progressWidth As Single + totalSlides = ActivePresentation.Slides.Count + For Each sld In ActivePresentation.Slides + For Each shp In sld.Shapes + If shp.Name = "BarreDeProgression" Then shp.Delete + Next + currentSlideIndex = sld.SlideIndex + progressWidth = (currentSlideIndex / totalSlides) * ActivePresentation.PageSetup.SlideWidth + Set shp = sld.Shapes.AddShape(msoShapeRectangle, 0, ActivePresentation.PageSetup.SlideHeight - 10, progressWidth, 10) + shp.Fill.ForeColor.RGB = RGB(0, 128, 255): shp.Line.Visible = msoFalse: shp.Name = "BarreDeProgression" + Next + MsgBox "Barre de progression ajoutée à toutes les diapositives !" +End Sub + diff --git a/BarreDeProgressionMacro_Corrected.txt b/BarreDeProgressionMacro_Corrected.txt new file mode 100644 index 0000000..9dc3bbe --- /dev/null +++ b/BarreDeProgressionMacro_Corrected.txt @@ -0,0 +1,15 @@ +Sub AjouterBarreDeProgression() + Dim sld As Slide, shp As Shape + Dim totalSlides As Integer, currentSlideIndex As Integer, progressWidth As Single + totalSlides = ActivePresentation.Slides.Count + For Each sld In ActivePresentation.Slides + For Each shp In sld.Shapes + If shp.Name = "BarreDeProgression" Then shp.Delete + Next + currentSlideIndex = sld.SlideIndex + progressWidth = (currentSlideIndex / totalSlides) * ActivePresentation.PageSetup.SlideWidth + Set shp = sld.Shapes.AddShape(msoShapeRectangle, 0, ActivePresentation.PageSetup.SlideHeight - 10, progressWidth, 10) + shp.Fill.ForeColor.RGB = RGB(0, 128, 255): shp.Line.Visible = msoFalse: shp.Name = "BarreDeProgression" + Next + MsgBox "Barre de progression ajoutée à toutes les diapositives !" +End Sub