AddToRecentFiles problem

Z

zSplash

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
 
G

Graham Mayor

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top