Case Of The Outlook Attachment Open Fail

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

image

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.

image

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.

image

Going into this folder found it was full of files…Deleting the files in this folder resolved the problem?

image

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.

image

2) Launch Outlook

2) Open an attachment

In this case I’m opening a .DOCX somebody sent me to look at

image

3) As soon as the file is opened we see two copies of the file in this folder:

image

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.

image

We now have a single file left in the temp folder

image

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

image

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 Smile

image

Script is located here (rename .txt to .cmd, remove REM cmd to make it actually delete contents)

https://skydrive.live.com/redir?resid=D1BB3113E6943B7F!2795&authkey=!AG_FSbjX3cRsSl4

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Batch Files, Command Line, Office, Windows 7 and tagged . Bookmark the permalink.

4 Responses to Case Of The Outlook Attachment Open Fail

  1. User says:

    Fantastic information, solved the user’s problem. Thank you.

  2. This deleted every single file on my C: drive. I’m not kidding. All I did was fix the quotes, save, and execute.

    • this is because wordpress has messed up the double & single quotes, i’ll remove this script and provide a download.

      • Thanks, that seemed to work.

        I am trying to automate the uninstallation of Cisco ViewMail for Outlook and then reset the default previewer of Outlook attachments that are .wav files to WMP. It was suggested to me that clearing your Outlook cache would accomplish this, which is how I found your script here. But it does not appear to have accomplished this unfortunately, as even after the uninstallation of ViewMail and the successful execution of your CMD file… Outlook still shows to have “no previewer installed”. WMP is set as the default program under Folder Options / File Types however. This is for XP and Outlook 2007 or 2010.

        Any suggestions would be much appreciated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s