Temporary internet files and my recent documents

Thursday 14 April 2005

I'm trying to get some info on a bit of Windows minutiae, and I can't find any. If you open a document (for example, a Word .doc file), it will appear both in the global My Recent Documents list (for example, off of the Start menu), and in the Word recent documents list (at the bottom of the File menu). But if the document is in the Temporary Internet Files directory (or any subdirectory thereof), then it doesn't appear in the list. For example, if you launch an attachment from Outlook, the file is detached to an Outlook subdirectory of the Temporary Internet Files directory, so that the temporary file doesn't appear in menus after you are done editing it.

The question is, why doesn't it appear in the list? I guessed things like "files in hidden directories aren't shown", but I've disproved all of them with empirical testing. The architect in me would like there to be an answer other than "That specific directory is treated specially by the recent documents code". I want to find a characteristic of that directory that can be applied to other directories of my creation.

Just to further confuse the issue, if you open a document from the ordinary temp directory (\Documents and Settings\ned\Local Settings\Temp), it appears in Word's recent document list, but not the system list!

And, I understand that these directories are not hardcoded, but are stored in the registry to acheive a level of indirection and customizability. So when I say "Temporary Internet Files" directory, I really mean the directory returned by SHGetFolderPath(CSIDL_INTERNET_CACHE).


Roger Lipscombe 10:52 AM on 14 Apr 2005

The function responsible for updating the "Documents" menu is SHAddToRecentDocs.

Have you called it directly with those various files (rather than via Word) to see where the filtering is occurring? i.e. is Word being clever, or is the API function being clever?

Ben Last 9:07 AM on 15 Apr 2005

Surely the reason that documents opened from within Outlook aren't on the list is because of the way they're opened; Outlook saves a temporary copy and kicks off Office to open it. Once it's closed, it might be arbitrarily deleted at any time (since it's in a temporary space). Hence I suspect the files themselves may have a "temporary" attribute that identifies them as ephemeral.

Sylvain Galineau 11:06 AM on 18 Apr 2005

The other one I'd like to understand is File-Save As in IE. It will create a foo.html file and a foo subdirectory for the inline images/objects of the page. Now delete foo.html from Windows Explorer and the subdirectory is removed as well. Firefox also does this. There is clearly a file system link between them.

Add a comment:

Ignore this:
not displayed and no spam.
Leave this empty:
not searched.
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.