Office Settings & Configuration

Display a PowerPoint Filename on the Slide Master

Tauseeq MagsiTauseeq Magsi Nov 14, 2026 868 views

Question details

The user wants to display the presentation filename on slides through the slide master.

How to Display a PowerPoint Filename on 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.
Before you start

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).

Solution 1Recommended

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.

1
Save as a macro-enabled file

In PowerPoint, select File > Save As and choose PowerPoint Macro-Enabled Presentation (*.pptm).

2
Open the VBA editor

On Windows, press Alt+F11 to open the Visual Basic Editor. In the editor, select Insert > Module.

3
Add the macro

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

4
Run and check the macro

Return to PowerPoint, open View > Macros, select AddFilenameToMasters, and click Run. Check several slides to confirm the filename is visible, then save the presentation.

Insert the filename on slide masters with a VBA macro
Check slide layouts: A layout or slide may hide or cover master graphics. If the filename is missing on a slide, check its layout and background graphics settings.
Free Microsoft Office alternative

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.

Add and format a filename text box on a presentation master slideOpen and edit Microsoft PowerPoint PPT and PPTX filesWork with familiar presentation editing controlsUse free core office tools in a lightweight suite
microsoft office alternative - wps office

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.