When trying to playback a voice mail message from Outlook a user received the following message This file cannot be previewed because of an error with the following previewer: Windows Media Player Rich Preview Handler
Attempting to double click the icon though caused this message Cannot save the attachment. Cannot create file: VoiceMessage.wav. Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder.
This is one of those error messages which is completely misleading. This is simply proven through use of ProcMon when attempting to open the attachment (http://live.sysinternals.com/ProcMon.exe)
We can see it starts by checking if VoiceMessage.wav exists, then if it already exists (i.e. NAME COLLISION) it check VoiceMessage (1).wav, and keeps going up until (99) after which it retries the original filename and fails ACCESS DENIED because the file already exists.
Going into this folder found it was full of files…Deleting the files in this folder resolved the problem?
Buy why did this occur in the first place?
We can re-reproduce the scenario that created this problem in the following way.
First we should find Outlook’s “secure” temp folder. This is found under
HKEY_CURRENT_USER\Software\Microsoft\Office\[office version number]\Outlook\Security\OutlookSecureTempFolder
In the case of Outlook 2010 the office version number will be 14.0. In my case the folder is located under
%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files\Content.Outlook\XPDV0I3U\
1) I’ve confirmed this folder is empty.
2) Launch Outlook
2) Open an attachment
In this case I’m opening a .DOCX somebody sent me to look at
3) As soon as the file is opened we see two copies of the file in this folder:
4) Now what if we close Outlook, but leave the Word document open?
Using Process Monitor we can see Outlook failed to open the file with access to delete it. This is because it was locked by Word.
We now have a single file left in the temp folder
Outlook will never attempt to clean up this file ever again.
5) If we re-launch Outlook and repeat the process. Now we have two copies of this file
Once this has occurred 100 times you will no longer be able to open the attachment. Typically you will only ever encounter this problem if people get many attachments with the same filename.
This has been a known issue in Outlook from Outlook 2003 – 2007 – 2010 as documented in Microsoft KB article http://support.microsoft.com/kb/817878
I suspect there is no permanent solution to this problem as it is rare and solutions like periodically cleaning the folder may have a performance impact.
The best way to prevent this issue is to ensure attachments are closed before closing Outlook.
But if you have a constant problem with it here is a little batch file that can clean the system (If you copy and paste the code it doesn’t work probably because WordPress messes up the quotes in my HTML they should be ‘straight down’ quotes.). Yeah batch files are archaic but growing up with MS-DOS 3.3 sometimes I still use them
Script is located here (rename .txt to .cmd, remove REM cmd to make it actually delete contents)