First, delete fastmail's "Junk Mail" folder if it currently exists. Then use the instructions below:
Install Collaboration Data Objects. (Note that it won't install directly - the file you downloaded just unpacks the real installer. Annoying.)
In Outlook, open the Visual Basic editor: either Alt+F11, or Tools - Macro - Visual Basic Editor
In the VB window, go to Tools - References, and enable CDO 1.2.1
in the list.
On the tree in left side, open Project1 - Microsoft Office Outlook - ThisOutlookSession, and paste this script (original source) to the window that opens:
Sub CDORenameFolder()
Dim outlookApp As Outlook.Application
Dim cdoSession As MAPI.Session
Dim folder As Outlook.MAPIFolder
Dim cdoFolder As MAPI.folder
Dim newName As String
Set outlookApp = New Outlook.Application
Set cdoSession = New MAPI.Session
cdoSession.Logon ShowDialog:=False, NewSession:=False
Set folder = outlookApp.Session.PickFolder()
Set cdoFolder = cdoSession.GetFolder(folder.EntryID, folder.StoreID)
newName = InputBox("Rename '" + cdoFolder.Name + "' to:", "Rename folder", cdoFolder.Name)
If newName <> "" Then
cdoFolder.Name = newName
cdoFolder.Update
End If
cdoSession.Logoff
Set cdoSession = Nothing
Set outlookApp = Nothing
End Sub
Press F5 (or Run - Run Sub), and run the ThisOutlookSession.CDORenameFolder
macro. A folder selection window should pop up. Under your IMAP account, choose the "Junk E-mail" folder (the one created by Outlook) and click OK.
(If you get "User-defined type not defined", then you forgot to install and/or activate CDO.)
Yes, that is exactly why I hate Outlook now.
If I'm reading this correctly -- you're hard-coding the destination folder name into the script, then running the script to pick the source? – afrazier – 2010-12-13T14:09:14.410
@afrazier: My VBScript skills are ... poor. At the time of posting, this is what I had -- copypasta from the Microsoft KB. (It seems I did rewrite the script later; I updated the post.) – user1686 – 2010-12-13T15:02:03.443
Ah, that makes more sense. To be fair to you, if that's what was in the MS KB, that's pretty sad too. – afrazier – 2010-12-13T16:11:50.903
@afrazier: No, it wasn't - the KB has a sane script with everything hardcoded - for quick renaming of all special folders to their original names. (See "original source" link.) – user1686 – 2010-12-14T10:13:53.503