Fill the MRU (Most Recently Used) list with bogus file names
Problem
PowerPoint shows the most recently used (MRU) files in a list on the File menu.
You may want to hide the names of recently used files for one reason or another.
Or you may want to prevent PPT from trying to access a drive (floppy, CD, network share) that's no longer available.
Solution
The following simple-minded little macro simply creates a new blank presentation then saves it multiple times as 1.ppt, 2.ppt ... 9.ppt, then closes the file.
That's enough to "stuff" the MRU list with bogus filenames, as it never contains more than 9 entries.
In PowerPoint 97, anyhow. But PowerPoint 2000 and later outsmart us: when macro code saves files, they don't get added to the MRU list. So we have two versions of this little macro, one for 2000 and up, one for 97.
In 2000 and up, you'll need to run the macro to create the files, then manually save and close each one before it appears on the MRU list.
Hint: use Ctl+S to Save, then Alt+F, C to close each file.
Sub StuffTheMRU2000()
' Use this with PPT 2000 and later
Dim DummyFilePath As String
Dim x As Long
Dim oPres As Presentation
' Edit this as you wish, but it MUST end with backslash
' and it should always be a path on the local hard drive
DummyFilePath = "c:\temp\"
' save it nine times to stuff the MRU list
For x = 1 To 9
' Create a new presentation
Set oPres = Presentations.Add(msoTrue)
' Add a slide to it
Call oPres.Slides.Add(1, ppLayoutBlank)
' Save it so it has a name
ActivePresentation.SaveAs FileName:=DummyFilePath & "Dummy" & CStr(x) & ".ppt"
Next
Set oPres = Nothing
MsgBox ("Done!" & vbCrLf _
& "Now save each file once again manually before closing it.")
End Sub
Sub StuffTheMRU97()
' Use this for PowerPoint 97
Dim ThePath as String
Dim i as Integer
' Edit this as you wish:
ThePath = "C:\"
' For example
' ThePath = "C:\BogusFiles\NonEntity" would give C:\BogusFiles\NonEntity1.ppt and so on
' Create a new presentation
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex
For i = 1 to 9
ActivePresentation.SaveAs FileName:=ThePath & cstr(i) & ".ppt"
Next i
' Close the presentation
ActiveWindow.Close
' Delete the files
On error resume next
For i = 1 to 9
Kill(ThePath & Cstr(i) & ".ppt")
Next i
End Sub
See How do I use VBA code in PowerPoint? to learn how to use this example code.
Search terms: