Hi, I am trying to create a macro that will re-insert master slides from a template from a location on the network, in case people delete them, I have the code below, it seems to work and run fine, but when you go into the master the slides aren’t added. I am not fully confident in vba so need a little help if possible
Thanks in advance
Sub CopyMasterSlidesFromNetwork() ' Specify the path to the PowerPoint file on the network Dim sourceFilePath As String sourceFilePath = "\\Network\Path\To\Your\Source\File.pptx" ' Replace with the actual network path ' Open the source presentation Dim sourcePresentation As Presentation Set sourcePresentation = Presentations.Open(sourceFilePath) ' Copy master slides from the source presentation Dim slideIndex As Integer For slideIndex = 1 To sourcePresentation.Slides.Count sourcePresentation.Slides(slideIndex).CustomLayout.Copy ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Paste Next slideIndex ' Close the source presentation without saving changes sourcePresentation.Close False End Sub



Reply With Quote

