From 3d0e3306c96b5d710d2f7d8b67b7b309b8f20ab9 Mon Sep 17 00:00:00 2001 From: William Lonfat Date: Sun, 5 Jan 2025 17:59:42 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"/"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les fichiers ici présents ont été réalisés pour faire une barre de progression sur PowerPoint adaptée au nombre de diapositives. --- Barre-de-progression.bas | 17 +++++++++++++++++ BarreDeProgressionMacro_Corrected.txt | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Barre-de-progression.bas create mode 100644 BarreDeProgressionMacro_Corrected.txt 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