Opening attachments with same name leaves temp files behind...   is this an outlook bug?

Posted on 2006-05-29
Last Modified: 2010-04-08
When we receive faxes our fax server forwards them as faxmessage.tif

when you open this in outlook it creates a temp file in temporary internet files.
when you close outlook this temp file is cleaned up

However if you open several faxes throughout the day it creates several like this

now when you close outlook only the last one gets cleaned up.  eventually you reach a limited of 100 and you can no longer open attachments with this name until you delete them

we are using windows default fax viewer to view these faxes
we are running windows 2000
the clients are outlook 2003

Question by:Zoldy2000
    LVL 76

    Expert Comment

    by:David Lee
    Hi Zoldy2000,

    One solution to this is a macro that'd run each time Outlook shuts down and delete these files.  Is that an option?

    LVL 2

    Author Comment

    Yes I suppose that would work... However I was looking for more of a solution rather than a work around...

    Thank you
    LVL 76

    Accepted Solution

    I'm not sure that Outlook is the culprit, although I suppose it could be.  Outlook saves its temporary files to a special folder at C:\Documents and Settings\<username>\Local Settings\Temporary Internet Files\OLK??? (where ??? = a 2 or 3 character string generated by Outlook).  If these files aren't in that folder, then Outlook may not be directly responsible for them.  The fax viewer software may be at fault.  Either way the macro below can clean them up.  It will fire each time Outlook is closed.  When it does, it will delete all.tif files in the Temporary Internet Files folder.  Follow these instructions to use it.

    1.  Start Outlook
    2.  Click Tools->Macro->Visual Basic Editor
    3.  If not already expanded, expand Microsoft Outlook Objects in the Project pane, then click on ThisOutlookSession
    4.  Copy the script below
    5.  Paste the script into the right-hand pane of the VB Editor
    6.  Click the diskette icon on the toolbar to save the changes
    7.  Close the VB Editor
    8.  Click Tools->Macro->Security
    9.  Set Security Level to Medium
    10.  Close Outlook
    11.  Start Outlook
    12.  A dialog-box will appear telling you the ThisOutlookSession contains macros and asking if you want to enable them.  Say yes.

    Sub Application_Quit()
        Dim objFSO As Object, _
            wshShell As Object, _
            wshEnv As Object, _
            strPath As String
        Set wshShell = CreateObject("WScript.Shell")
        Set wshEnv = wshShell.Environment("PROCESS")
        strPath = wshEnv.Item("USERPROFILE")
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        On Error Resume Next
        objFSO.DeleteFile strPath & "\Local Settings\Temporary Internet Files\*.tif", True
        Set wshEnv = Nothing
        Set wshShell = Nothing
        Set objFSO = Nothing
    End Sub

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    Outlook Free & Paid Tools
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now