Some people like to have voicemail forwarded to email, but when they try to listen, the attachment won’t open. That’s because Outlook SecureTempFolder is full. Here’s how to automatically empty it upon closing Outlook.

In Outlook SecureTemp Files Folder and Red X’s in Email Messages I explain what the SecureTemp folder is and issues that result from a “full” SecureTemp folder. I also tell you how to find the folder and empty it manually.

While you can delete the contents of the SecureTempFolder manually, you may want to delete the folder each time you close Outlook.

Source: Clear SecureTempFolder automatically using VBA

TLDR: Here is the script that you add to ThisOutlookSession using the VBA script editor ([Alt]-[F11]):

Option Explicit

'If you prefer to run this manually whenever you feel like it, change Private Sub Application_Quit() to Public Sub EmptySecureTemp() and run it as needed.
Private Sub Application_Quit()
'=====================================================================
' Deletes the files of the SecureTempFolder (OLK) when closing Outlook
' (c) Peter Marchert - //www.outlook-stuff.com
' 2008-11-06 Version 1.0.0
'=====================================================================
Dim objFSO As Object
Dim objWsh As Object
Dim objFolder As Object
Dim strRegKey As String
Dim strOLK As String

On Error Resume Next
'---------------------------------------------------------------------
' To read data from the registry
'---------------------------------------------------------------------

Set objWsh = CreateObject("WScript.Shell")

'---------------------------------------------------------------------
' Set the registry key to read
'---------------------------------------------------------------------

strRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\%.0\Outlook\Security\OutlookSecureTempFolder"

'---------------------------------------------------------------------
' Read SecureTempFolder from the registry
'---------------------------------------------------------------------

Select Case Left(Outlook.Version, 2)
Case "9.": strOLK = objWsh.RegRead(Replace(strRegKey, "%", "9"))
Case "10": strOLK = objWsh.RegRead(Replace(strRegKey, "%", "10"))
Case "11": strOLK = objWsh.RegRead(Replace(strRegKey, "%", "11"))
Case "12": strOLK = objWsh.RegRead(Replace(strRegKey, "%", "12"))
Case "14": strOLK = objWsh.RegRead(Replace(strRegKey, "%", "14"))
Case Else
MsgBox "Cannot determine your Outlook version.", vbCritical + _
vbOKOnly, "Delete OLK"
Exit Sub

End Select

'---------------------------------------------------------------------
' VBA does not provide comfortable functions to delete files, so we use
' VB-Script.
'---------------------------------------------------------------------

Set objFSO = CreateObject("Scripting.FileSystemObject")

'---------------------------------------------------------------------
' Delete all files in the SecureTempFolder (True = force deleting)
'---------------------------------------------------------------------

Call objFSO.DeleteFile(strOLK & "*.*", True)

'---------------------------------------------------------------------
' Reference the SecureTempFolder
'---------------------------------------------------------------------

Set objFolder = objFSO.GetFolder(strOLK)

'---------------------------------------------------------------------
' Open the folder if it is not empty
'---------------------------------------------------------------------

If objFolder.Files.Count Then Call Shell("explorer.exe " & strOLK)

'---------------------------------------------------------------------
' Clean Up
'---------------------------------------------------------------------

Set objFolder = Nothing
Set objFSO = Nothing
Set objWsh = Nothing
End Sub

I had an issue where a user was having certain, not all but certain, emails moved into a folder called “Unwanted”. This was weird, as she never created said folder and Outlook doesn’t come with such a folder by default.

It took quite a while to sort it out. We removed rules, created new profiles and created new OST files, but to no avail. There were no server-side functions that would do this, either.

The hint came from the below article. Oddly enough, the article speaks of a “Junk” folder instead of “Unwanted”, but it turned out that the user had a Samsung phone.

Problem: Outlook creates a new folder called “Junk” and moves internal mail to the Junk folder.

Source: Samsung smartphones move email to the Junk folder


I’ve actually had dreams (nightmares?) lately about Microsoft license activation, believe it or not, as it is such a pain in the ***. Both Microsoft Windows and Microsoft Office can get to the point where they cannot or will not talk to the KMS server and grab a license for one reason or the other. So, this is how to force the issue when you have enterprise versions of this software.

One scenario is where Windows quits talking to the KMS server, goes beyond the grace period and then declares that this copy of windows is not genuine. You can try to activate it, but it will refuse because it is out of the grace period. Of course, it is outside of the grace period because it did not activate, so this causes a bit of a catch-22.

The way to break out of the cycle is to extend the grace period. You do this via the “rearm” command. For example, open a command prompt with elevated privileges and type:

slmgr.vbs /rearm
slmgr.vbs /ato

That will rearm activation, thus extending the grace period, and then activate windows (it assumes KMS is online).