If I'm right about Application.RecentFiles.Count (this value is the
smaller of the number of entries in the registry and the
Application.RecentFiles.Maximum (this last is the -Number of Recent
files to show-)) being possibly smaller than the number of entries in
the registry, then code so far put forward will only delete those
visible in the Office Button list; others in the registry will move up
and become visible in the Office Button list. So we could temporarily
set the -Number of Recent files to show- to its maximum of 50 and put it
back to its previous setting afterwards:
OriginalMax = Application.RecentFiles.Maximum
Application.RecentFiles.Maximum = 50
'do the main processing here
Application.RecentFiles.Maximum = OriginalMax
Now as long as there are never more than 50 entries in the registry
(can there be?) it should never have to be run more than once.
--
p45cal
*p45cal*
------------------------------------------------------------------------
p45cal's Profile:
http://www.thecodecage.com/forumz/member.php?userid=558
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=147510