Group: microsoft.public.word.vba.general
From: "Graham Mayor"
Date: Friday, March 14, 2008 5:27 AM
Subject: Re: AddToRecentFiles problem

Using your code (but changing the filename for testing) the following does
not add to the recent file list in either Word 2003 or 2007?

With ActiveDocument
.SaveAs FileName:="D:\My Documents\Test\Versions\Odd\" & nNum &
"test.txt", _
FileFormat:=wdFormatText, AddToRecentFiles:=False
.Close savechanges:=wdDoNotSaveChanges
End With


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


zSplash wrote:
> I'm trying to programmatically create some text files so that they
> don't appear in the Recent Documents list. Here's the pertinent part
> of what I've coded:
>
> ActiveDocument.SaveAs FileName:="\test\c" & nNum & ".txt",
> fileformat:=wdFormatText, AddToRecentFiles:=False
> ActiveDocument.Close savechanges:=wdDoNotSaveChanges 'False
>
> I read in the usergroups that both the SaveAs and the Close methods
> add to the Recent Docs list. Stepping through the code, after the
> "SaveAs" line, the text filename does not appear in the Recent Docs
> list; when I step through the next line, however, the textfilename
> does appear in the Recent Docs list.
>
> Any suggestions as to how to keep the text filename from appearing in
> the Recent Docs list?
>
> TIA