Supercharge your PowerPoint productivity with

Supercharge your PPT Productivity with PPTools - Click here to learn more.

Tell me about PPTools

Fill the MRU (Most Recently Used) list with bogus file names


PPTools
Shape Styles brings the power of styles to PowerPoint. Apply complex formatting with a single click
Merge Excel, CSV or tab-delimited data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more
FixLinks prevents broken links when you distribute PowerPoint presentations
Optimizer saves disk space and bandwidth, shrinks your PowerPoint presentations to the right size for email, screenshow or printing
PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements
Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF
Image Export converts PowerPoint slides to JPG, PNG, GIF, WMF and more

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:


Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2008 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese



Supercharge your PPT Productivity with PPTools


content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Fill the MRU (Most Recently Used) list with bogus file names
http://www.pptfaq.com/FAQ00373.htm
Last update 16 October, 2006