Display a PowerPoint Filename on the Slide Master
Question details
The user wants to display the presentation filename on slides through the slide master.

- Product
- Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- Add a filename footer to a presentation so it appears across slides.
- Observed behavior
- PowerPoint does not provide a standard slide-master field that automatically displays the presentation filename.
Save the presentation with its intended filename and check whether your organization permits VBA macros. If you use the macro, save the presentation as a PowerPoint Macro-Enabled Presentation (.pptm).
Insert the filename on slide masters with a VBA macro
Use this method to insert the current filename on each slide master without typing it manually.
The macro writes the current filename into a named text box on each slide master. It does not update the filename automatically; run it again after renaming the file.
In PowerPoint, select File > Save As and choose PowerPoint Macro-Enabled Presentation (*.pptm).
On Windows, press Alt+F11 to open the Visual Basic Editor. In the editor, select Insert > Module.
Paste this code into the module: Sub AddFilenameToMasters() Dim p As Presentation Dim d As Design Dim s As Shape Set p = ActivePresentation If p.Path = "" Then MsgBox "Save the presentation first." Exit Sub End If For Each d In p.Designs Set s = Nothing On Error Resume Next Set s = d.SlideMaster.Shapes("PresentationFilename") On Error GoTo 0 If s Is Nothing Then Set s = d.SlideMaster.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, p.PageSetup.SlideHeight - 25, p.PageSetup.SlideWidth - 20, 18) s.Name = "PresentationFilename" End If s.TextFrame.TextRange.Text = p.Name s.TextFrame.TextRange.Font.Size = 10 Next d End Sub
Return to PowerPoint, open View > Macros, select AddFilenameToMasters, and click Run. Check several slides to confirm the filename is visible, then save the presentation.

Add the filename manually to the slide master
Use a text box when you prefer not to use macros and can update the filename yourself.
Edit presentation master slides with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and PowerPoint format compatibility for an easier transition. In WPS Presentation, you can add a filename as text on a slide master; this does not automate PowerPoint's filename field or fix its VBA behavior.

Frequently Asked Questions
Can PowerPoint automatically show the filename in a footer?
PowerPoint does not provide a standard filename field for slide-master footers. You can use a VBA macro to insert the name or type it into a text box in View > Slide Master.
Will the macro update the filename after I rename the presentation?
No. Open the renamed presentation and run AddFilenameToMasters again from View > Macros to refresh the text.
Why doesn't the filename appear on every slide?
Some slides may use a different master or hide or cover master graphics. Check the slide's layout and background graphics settings, and confirm that the filename text box exists on the relevant master.
What file type should I use for the VBA macro?
Select File > Save As and choose PowerPoint Macro-Enabled Presentation (*.pptm) to retain the macro. Macro execution may also be restricted by your organization's security settings.




