A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
Hi,
Are you assuming that the presentation will have only one master?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have the following code to reset my template to a common master file (MR.potm). It works for most files, but not all.
I would note that if I manually rename the slide master away from 'IRL_BUR_Template' to something like xx then this code works fine which has me stumped.
I'm assuming that this line will do the same as a manual template rename (open VIEW / SLIDEMASTER / <right click RENAME> etc.:
application.ActivePresentation.SlideMaster.Name = "xx"
Any help or comments greatly appreciated,
Thanks!
Sub Set_MgtRvw_Template()
Dim strP, strF As String
Debug.Print "---------------- " & Now()
Debug.Print "---------------- Re-Setting Template Slide Master"
' Rename current template to enable new application of the same if the name is unchanged...
application.ActivePresentation.SlideMaster.Name = "xx"
DoEvents
' Dim HasIRLBURTemplate As Boolean
' JUST GO AHEAD AND ADD THE CORRECT TEMPLATE (No Worries if Duplicate):
strP = "C:\Documents and Settings\xxx\Application Data\Microsoft\Templates"
strF = "MR.potm"
strF = strP & strF
application.ActivePresentation.ApplyTemplate (strF)
application.ActivePresentation.ApplyTheme (strF)
On Error Resume Next ' Defer error handling.
Err.Clear
' DELETE ALL BUT THE REQURED TEMPLATE (Duplicates start with n_xxxx and get deleted):
Do While Err.Number = 0
' If Application.ActivePresentation.SlideMaster.Name <> "IRL_BUR_Template" Then
If application.ActivePresentation.SlideMaster.Name <> "MR_IRL_Template" Then
application.ActivePresentation.SlideMaster.Delete
' MsgBox Err.Number & " !! " & Err.Description
End If
Loop
' MAKE ALL SLIDE NUMBERS VISIBLE:
application.ActivePresentation.PageSetup.FirstSlideNumber = 1
For Each s In ActivePresentation.Slides
s.ApplyTemplate (strF)
s.DisplayMasterShapes = True
s.HeadersFooters.Clear
s.HeadersFooters.DisplayOnTitleSlide = True
s.HeadersFooters.SlideNumber.Visible = True
s.HeadersFooters.SlideNumber.Text = "Page : <#>"
Next
Debug.Print "---------------- "
End Sub
A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Hi,
Are you assuming that the presentation will have only one master?
Designs looks like a much better, more correct, way to update/replace my template. I particularly like the .Load method in your reference article. Thank you for pointing me to this. Time for me to explore my DESIGNS. Options... !