Difference between revisions of "Outlook"

From YobiWiki
Jump to navigation Jump to search
m
 
(73 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
<br>At least under Lotus Notes it was possible to add an IMAP account (BTW Lotus Notes crashed quite often when talking IMAP...)
 
<br>At least under Lotus Notes it was possible to add an IMAP account (BTW Lotus Notes crashed quite often when talking IMAP...)
 
<br>Here: Tools->Account Settings->''This feature has been disabled by your system administrator''
 
<br>Here: Tools->Account Settings->''This feature has been disabled by your system administrator''
==Injecting IMAP settings==
 
   
  +
== References ==
Outlook Express client was also present on the Windows machine so I launched it
 
  +
* Microsoft Office 2007 Resource Kit (official documentation from Microsoft)
  +
** [http://technet.microsoft.com/en-gb/library/cc178979.aspx Documentation page]
  +
*** [http://go.microsoft.com/fwlink/?LinkId=85671 Security for the 2007 Office release]
  +
*** [http://go.microsoft.com/fwlink/?LinkID=94264 Group Policy overview for the 2007 Office release]
  +
** [http://go.microsoft.com/fwlink/?LinkId=78161 Administrative template (ADM,ADMX,...) files]
  +
*** Use [http://www.7-zip.org/ 7-zip] to decompress this file without installing it. Don't miss the summary excel sheet inside.
  +
* ''Configuring Microsoft Outlook 2003'', By Sue Mosher, Robert Sparnaaij, Charlie Pulfer, David Hooker.
  +
** Excellent book for administering Outlook 2003. Content can be browsed/searched on [http://books.google.com/books?id=v8oZNEByTR0C Google Books].
  +
* Excellent 3rd party page on Outlook policy: http://www.howto-outlook.com/howto/policies.htm
  +
* Folder with interesting policy settings on Outlook [http://theether.net/download/Microsoft/Office/2007/].
  +
  +
== Unlocking ==
  +
  +
===Main registry keys===
  +
Apparently important registry keys are under:
  +
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook
  +
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook
  +
Some tips [http://www.hotline-pc.org/outlook.htm here] (french)
  +
  +
===IMAP settings===
  +
  +
We can remove the admin barrier on account management:
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Setup\ModifyAccounts
  +
=0
  +
  +
Another way without modifying the Registry is to use the import feature:
  +
<br>If e.g. Outlook Express client is also present on the Windows machine
 
* In Outlook Express:
 
* In Outlook Express:
 
** Wizard -> typed my IMAP&SMTP settings
 
** Wizard -> typed my IMAP&SMTP settings
 
* In Outlook:
 
* In Outlook:
 
** File -> Import and Export... -> Import Internet Mail Account Settings -> Microsoft Outlook Express or Microsoft Windows Mail -> Wizard allowing to edit the imported settings :-)
 
** File -> Import and Export... -> Import Internet Mail Account Settings -> Microsoft Outlook Express or Microsoft Windows Mail -> Wizard allowing to edit the imported settings :-)
** Then write a new mail -> Account (below Send button) -> select your new account -> Prompted to choose the sent folder, ok -> you've a multiple tabs config view of your new account, possibility to switch servers to TLS, changing name of the account, saying you need auth to talk to your SMTP etc etc
+
** Then write a new mail -> Account (below Send button) -> select your new account -> Send test mail -> Prompted to choose the sent folder, ok -> you've a multiple tabs config view of your new account, possibility to switch servers to TLS, changing name of the account, saying you need auth to talk to your SMTP etc etc
  +
** If you need to tune IMAP settings later, go to registry and reset key (000000NN must be replaced with the number of your IMAP profile)
  +
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\000000NN\IMAP Sentitems
  +
= 0
   
Previously I tried importing from Eudora Light & Eudora but Outlook didn't see anything
+
Note that I also tried importing from Eudora Light & Eudora but Outlook didn't see anything
  +
==PST to Maildir==
 
  +
Access to accounts management can be also blocked slightly differently: if you can access accounts managemetn but cannot create e.g. a new IMAP account, it's because those account types are disabled selectively, e.g. you need to change:
  +
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\DisableIMAP
  +
=0
  +
or
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\DisableIMAP
  +
=0
  +
or
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\outlook\options\disableimap
  +
=0
  +
  +
=== Cached Exchange Mode ===
  +
The following keys were set in my configuration, preventing to change the settings related to ''Cached Exchange Mode''. In particular the mode selection was disabled, ie. the options ''Download full items'', ''Download headers and then full items'', ''Download headers'' were all grayed out.
  +
<source lang="reg">
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
  +
"CachedExchangeMode"=dword:00000001
  +
"Enable"=dword:00000001
  +
"NoDrizzle"=dword:00000001
  +
"NoFullItems"=dword:00000001
  +
"NoHeaders"=dword:00000000
  +
"NoManualOnlineSync"=dword:00000001
  +
"SyncPFFav"=dword:00000001
  +
</source>
  +
To unlock all settings, and eg. allow download full headers, simply delete values ''CachedExchangeMode'', ''NoDrizzle'', ''NoFullItems'', ''NoHeaders'', and ''NoManualOnlineSync'' (ie. all but ''Enable'' and ''SyncPFFav'').
  +
  +
===Changing JunkMail levels===
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\Mail\JunkMailProtection
  +
No Protection = 0xffffffff = 4294967295
  +
Low = 6
  +
High = 3
  +
Trusted Lists Only = 0x80000000 = 2147483648
  +
To enable the JunkMail otions in the Options->Preferences->E-Mail->Junk E-mail menu
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\DisableAntiSpam
  +
=0
  +
  +
===AutoArchive===
  +
Recently the function ''AutoArchive'' vanished from Outlook, don't panic! To enable AutoArchive in the Menu->File again just change the following registry value:
  +
  +
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences\DisableManualArchive = 0
  +
  +
Changing this value is not sufficient to get access back the AutoArchive options. You need to delete the entire registry key ''Preferences''. Not sure everything needs to go, but it does the work.
  +
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences]
  +
  +
===All in one registry file===
  +
You can also put all the above registry modifications in one single file [{{#file:Outlook.reg}} Outlook.reg]
  +
<source lang=reg>
  +
Windows Registry Editor Version 5.00
  +
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook]
  +
"DisableAntiSpam"=dword:00000000
  +
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
  +
"NoFullItems"=-
  +
"NoDrizzle"=-
  +
"NoHeaders"=-
  +
"CachedExchangeMode"=-
  +
"NoManualOnlineSync"=-
  +
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\Mail]
  +
"JunkMailProtection"=-
  +
  +
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Setup]
  +
"ModifyAccounts"=dword:00000000
  +
  +
;Take care of that one, it could delete more than intended...
  +
[-HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences]
  +
</source>
  +
  +
...and modify the registry at each startup with the following command:
  +
regedit /s Outlook.reg
  +
  +
'''Note''': the hyphens after the registry value and in front of the registry key indicates respectively a request to delete the value and the entire key. See http://support.microsoft.com/kb/310516 for details.
  +
  +
==Group Policy and other configuration hints==
  +
  +
* [http://technet.microsoft.com/en-us/library/cc303396.aspx Configure Outlook security and protection features]
  +
* [http://books.google.com/books?id=v8oZNEByTR0C&pg=PA232&lpg=PA232&dq=Outlook+policy+JunkMailProtection+registry&source=web&ots=NgPRrRu7ms&sig=0Fz7fiRm-hpc8GQTp9od3GtLLrM&hl=en&sa=X&oi=book_result&resnum=9&ct=result#PPA221,M1 Configuring Microsoft Outlook 2003]
  +
  +
To use the Group Policy for Microsoft Outlook 2007 you may need to install the Outlook Group Policy template [http://www.yobi.be/files/outlk12.adm Outlk12.adm]
  +
  +
# Copy the policy template Outlk12.adm into %WINDIR%\inf
  +
# Open Group Policy Editor: Start-> Run-> gpedit.msc
  +
# Add template:
  +
## Select User Configuration
  +
## Right-click on Administrative Templates
  +
## Select Add/Remove properties-> Click Add button
  +
## Browse to %WINDIR%\inf and select Outlk12.adm
  +
  +
==iCalendar==
  +
Outlook does not handle correctly the iCal file (*.ics) with recurrent event.
  +
  +
Problem: when opening (eg.: double-click on the attachment) an iCal file with multiple events, ie. multiple VEVENT sections, Outlook tries to add a complete calendar. Your are prompted with a dialog box with the following question: '''Add this Internet Calendar to Outlook'''. It is probably not what you want. Most probably you just need to add the multiple events in your existing calendar.
  +
  +
The solution requires to save the iCal file on your hard drive and import it back using the import function.
  +
  +
# Save file as...
  +
# File -> Import and Export...
  +
# Select ''Import and iCalendar (*.ics) or vCalendar (.vcs)''
  +
# Browse and select your saved iCal file, done.
  +
  +
Solution source: https://events.sfu.ca/manual/en/iCalExporter.htm.
  +
  +
==Moving PST location==
  +
cf [http://azcarya.blogspot.com/2008/02/gmail-outlook-2007-and-imap.html this post]
  +
  +
# Close Outlook.
  +
# Open Control Panel -> Choose Mails -> Click on Data files.
  +
# Select the Account name and check for the location of the PST file. Leave the window open.
  +
# Open the folder containing the PST. Move the PST to the desired location.
  +
# Do NOT rename the file - if you do Outlook creates a new file in the default location again.
  +
# Switch to the Data Files window (as opened in Step 2) and double click on the PST file location.
  +
# This displays an error window, Ignore the error, and point to the new location. Close the windows.
  +
# Restart Outlook.
  +
# Outlook may create a new PST in the default location again, delete it, in such a case.
  +
  +
==Recovering PST password==
  +
Password protection of PST is terribly wrong.
  +
  +
Get [http://www.nirsoft.net/utils/pst_password.html PstPassword, a free Outlook PST Password Recovery], launch it and launch your PST, you'll get instantly a password, actuallt many passwords, and they will all work! How is it possible? Read [http://www.nirsoft.net/articles/pst_password_bug.html this].
  +
  +
Note that McAfee detects the program as "Potentially Unwanted Program", a "[http://vil.nai.com/vil/content/v_150020.htm Generic PUP.z]":
  +
<br>''McAfee(R) Avert™ recognizes that this program may have legitimate uses in contexts where an authorized administrator has knowingly installed this application''
  +
<br>But still no question, the program is simply erased by McAfee.
  +
<br>One easy solution: open it under andLinux and run it with WINE :-)
  +
  +
Apparently this can work both on "compressible encryption" and "high encryption" types of PST.
  +
==Coping with enterprise backup policy==
  +
The policy states:
  +
* Original e-mail and 'unique copies' must be stored in the mailbox or in the Central Vault (a Symantec stuff for central storage).
  +
* Copies of original e-mail can be stored locally to support working offline for which the original is available in the mailbox or Central Vault.
  +
* Original e-mail is e-mail as it enters MS Outlook or Central Vault.
  +
* A 'unique copy' is an original e-mail that has been modified.
  +
* This policy applies to all mailboxes in MS Outlook and Central Vault.
  +
So what we can do is:
  +
* Create a local .PST (or local IMAP) where you'll really archive your mails.
  +
* Don't create folders in the exchange mailbox but instead in your local .PST
  +
* In Exchange mailbox, only create a single folder called 'EV crap' or 'EV overload', or simply 'EV'
  +
* To archive a mail, you copy it from Exchange Inbox to your local .PST, then you move it to your 'EV' folder.
  +
* Every once in a while you go to your 'EV' folder, and you mass-send them to Enterprise Vault. Time to take a coffee break! (or two) (well, take a day off).
  +
  +
You can setup a rule to do this automatically
  +
  +
* Go to Tools --> Rules and Alerts --> New Rules
  +
* Select Start from a blank rule / Check messages after sending, then click Next
  +
* Click Next again and confirm rules applies to all sent mails
  +
* Select "Move a copy to the specified folder"
  +
* Click on "specified", and create a new EV folder in your inbox for instance, select 'EV' folder. Click Next.
  +
* Click Next again (no exception)
  +
** or optionally you can add exception for private mails by e.g. selecting "except if the subject contains specific words"
  +
** Click on "specific words" and add your keywords, such as "private", "Private", "PRIVATE", etc
  +
* Give rule a name (eg. Auto EV sent message), click Finish.
  +
  +
You can do the same so that any incoming mail is automatically copied to given folder:
  +
* Go to Tools --> Rules and Alerts --> New Rules
  +
* Select Start from a blank rule / Check messages when they arrive, then click Next
  +
* Click Next again.
  +
* Select "Move a copy to the specified folder"
  +
* Click on "specified", and create a new EV folder in your inbox for instance, select 'EV' folder. Click Next.
  +
* Click Next again (no exception).
  +
** or optionally you can add exception for private mails by e.g. selecting "except if the subject contains specific words"
  +
** Click on "specific words" and add your keywords, such as "private", "Private", "PRIVATE", etc
  +
* Give rule a name (eg. Auto EV incoming message), click Finish.
  +
  +
With these 2 rules, you can continue archive your mails normally in the local PST (remember don't make folders in exchange account, it's useless). For compliance with EV policy, you only need to go once in a while to the EV folder, and mass send all mails there in EV.
  +
  +
Good luck!
  +
  +
==Installing a local IMAP server on Windows==
  +
One possibility is uw-imap in Cygwin but if you want to use courier-imap, compilation under Cygwin is a nightmare... not anymore, see [[Courier-Cygwin]]
  +
<br>One easy way is to install courier-imap within AndLinux, e.g. following instructions at https://help.ubuntu.com/community/Courier
  +
  +
==Macros==
  +
===Installation===
  +
To install a macro:
  +
* Alt-F11 in Outlook
  +
* Open Project1 -> Microsoft Office Outlook Objects -> ThisOutlookSession (double-click)
  +
* copy/paste code
  +
* close & save
  +
If required, allow unsigned macros:
  +
* Tools -> Macro -> Security -> Macro Security -> Warning for all macros
  +
You'll have annoying popup at startup but there is no way around
  +
  +
====Adding toolbar button to execute a Macro====
  +
# Create a new toolbar. Right-click on any Outlook toolbar and choose "Customize." From the Toolbars tab, hit the "New" button, and name your toolbar anything you want (like "my shortcuts"). Drag and drop your new toolbar to the top of Outlook to dock it next to your other toolbars.
  +
# Add a Macro to your new toolbar. With the Customize dialog still open, go to its Commands tab. From the Commands tab, scroll down the Categories list, select Macros. In the Commands list select, drag and drop your Macro to your new toolbar.
  +
# Customize your new shortcut/button. With the Customize dialog still open, go to its Commands tab. Click on the new button in the toolbar (not in the Customize dialog). The button ''Modify Selection'' in the Customize dialog is now enabled. Click on it to change multiple properties of your new toolbar button.
  +
  +
Solution source: http://lifehacker.com/381966/tweak-microsoft-outlook-to-empty-your-inbox-faster
  +
  +
<br>Todo: add the macro in the right-click menu.
  +
  +
===Send & Save===
  +
Lotus Notes can prompt the sender to specify what folder a message should be saved in. In Outlook, you can set the storage folder on the Options dialog. This VBA code reproduces something closer to the Notes behavior by popping up the Select Folder dialog when the user sends the message. (see [http://www.outlookcode.com/d/code/setsavefolder.htm here] and [http://www.outlookcode.com/codedetail.aspx?id=456 there])
  +
<br>''UPDATE:'' Avoid treating appointments as it fails.
  +
<source lang=vb>
  +
Private Sub Application_ItemSend(ByVal Item As Object, _
  +
Cancel As Boolean)
  +
Dim objNS As NameSpace
  +
Dim objFolder As MAPIFolder
  +
Set objNS = Application.GetNamespace("MAPI")
  +
If TypeOf Item Is MailItem Then
  +
Set objFolder = objNS.PickFolder
  +
If TypeName(objFolder) <> "Nothing" Then
  +
Set Item.SaveSentMessageFolder = objFolder
  +
End If
  +
End If
  +
Set objFolder = Nothing
  +
Set objNS = Nothing
  +
End Sub
  +
</source>
  +
If you don't want this pop-up all the time but to sort on casual base, you can use the built-in option:
  +
* While writing a new mail, select "Options" tab (not the "Options" toolbar) -> "Save Sent Item" button -> Other Folder -> Select
  +
  +
===Move To Archive===
  +
Lotus Notes provided a way to archive mails manually. This feature is not supported by Outlook. To point is to select one or multiple mails in the inbox and move then with one single action to an archive folder. The following macro helps you to move mail into a dedicated archive folder (selected PST file + selected folder):
  +
<br>'''Note''':You may need to change the name of the PST file (''"Personal Folders"'') and the target folder (''"Ancient Archive"'') according to your setup.
  +
  +
'''OBSOLETE''': take a look at the macro ''Archive Now''
  +
  +
<source lang=vb>
  +
Sub MoveToArchive()
  +
On Error Resume Next
  +
Dim objFolder As Outlook.MAPIFolder
  +
Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem
  +
  +
Set objNS = Application.GetNamespace("MAPI")
  +
Set objFolder = objNS.Folders("Personal Folders").Folders("Ancient Archive")
  +
'Assume this is a mail folder
  +
  +
  +
If objFolder Is Nothing Then
  +
MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER"
  +
End If
  +
  +
  +
If Application.ActiveExplorer.Selection.Count = 0 Then
  +
'Require that this procedure be called only when a message is selected
  +
Exit Sub
  +
End If
  +
  +
For Each objItem In Application.ActiveExplorer.Selection
  +
If objFolder.DefaultItemType = olMailItem Then
  +
If objItem.Class = olMail Then
  +
objItem.UnRead = False
  +
objItem.Move objFolder
  +
End If
  +
End If
  +
Next
  +
  +
Set objItem = Nothing
  +
Set objFolder = Nothing
  +
Set objNS = Nothing
  +
End Sub
  +
</source>
  +
<br>Solution source: http://www.yeraze.com/article.php/outlook_macro_move_to_folder_mark_Read
  +
  +
===Archive Now===
  +
The ''Archive Now'' macro better mimic the expected behavior of the ''Archive Selected Items'' of Lotus Notes (I never thought I would like to mimic anything from Lotus Notes,...) This ''Archive Now'' macro moves the selected mails, meetings and appointments ('''NEW''') in the same sub-folder as its original location. Note that the archive operation does not depend on any time and date information. All selected mails, meetings and appointments will be archived/moved.
  +
<br>'''Note''': you may need or want to change the destination name (ie: ''"Archive Folders"'')
  +
  +
<source lang=vb>
  +
' Routine/Macro to archive selected mails into given data file
  +
Sub ArchiveNow()
  +
On Error Resume Next
  +
MoveToFolder ("Archive Folders")
  +
End Sub
  +
'
  +
' Function to move selected mails into given data file
  +
Public Function MoveToFolder(destName As String)
  +
Dim objNS As Outlook.NameSpace
  +
Dim objApp As Application
  +
Dim objFolder As Outlook.MAPIFolder
  +
Dim strCurrentFolderRootName As String
  +
Dim strDestinationFolderPath As String
  +
Dim objItem As Object
  +
  +
On Error Resume Next
  +
  +
' Some basic initialization, get app & namespace objects
  +
Set objApp = CreateObject("Outlook.Application")
  +
Set objNS = objApp.GetNamespace("MAPI")
  +
  +
' Abort if nothing selected
  +
If objApp.ActiveExplorer.Selection.Count = 0 Then
  +
'Require that this procedure be called only when a message is selected
  +
Exit Function
  +
End If
  +
  +
' Abort if destination == source
  +
strCurrentFolderRootName = GetFolderRootName(objApp.ActiveExplorer.CurrentFolder)
  +
If strCurrentFolderRootName = destName Then
  +
' Require that this procedure be called outside destination folder
  +
Exit Function
  +
End If
  +
  +
' Get destination folder path
  +
strDestinationFolderPath = Replace(objApp.ActiveExplorer.CurrentFolder.FolderPath, _
  +
"\\" + strCurrentFolderRootName, destName)
  +
  +
' Get destination folder object
  +
Set objFolder = GetFolder(strDestinationFolderPath)
  +
  +
' Check if destination folder exist, if not create it!
  +
If objFolder Is Nothing Then
  +
Dim Response
  +
Response = MsgBox("Folder '" + strDestinationFolderPath + "' does not exist. " + _
  +
"Do you want to create it?", vbYesNo + vbExclamation, "Folder not found")
  +
If Response = vbYes Then
  +
CreateFolder (strDestinationFolderPath)
  +
Set objFolder = GetFolder(strDestinationFolderPath)
  +
If objFolder Is Nothing Then
  +
MsgBox "The destination folder creation failed!", vbOKOnly + vbExclamation, "INVALID FOLDER"
  +
Exit Function
  +
End If
  +
Else
  +
Exit Function
  +
End If
  +
End If
  +
  +
' Move mails, meetings and appointments to destination folder
  +
For Each objItem In objApp.ActiveExplorer.Selection
  +
If objFolder.DefaultItemType = olMailItem Then
  +
' Process Mail item
  +
If TypeOf objItem Is MailItem Then
  +
Dim objMailItem As Outlook.MailItem
  +
Set objMailItem = objItem
  +
objMailItem.UnRead = False
  +
objMailItem.Move objFolder
  +
Set objMailItem = Nothing
  +
End If
  +
' Process Meeting item
  +
If TypeOf objItem Is MeetingItem Then
  +
Dim objMeetingItem As Outlook.MeetingItem
  +
Set objMeetingItem = objItem
  +
objMeetingItem.UnRead = False
  +
objMeetingItem.Move objFolder
  +
Set objMeetingItem = Nothing
  +
End If
  +
' Process Appointment item - NOTE: not sure it will ever be necessary
  +
If TypeOf objItem Is AppointmentItem Then
  +
Dim objAppointItem As Outlook.AppointmentItem
  +
Set objAppointItem = objItem
  +
objAppointItem.UnRead = False
  +
objAppointItem.Move objFolder
  +
Set objAppointItem = Nothing
  +
End If
  +
End If
  +
Next
  +
  +
Set objNS = Nothing
  +
Set objApp = Nothing
  +
Set objItem = Nothing
  +
Set objFolder = Nothing
  +
End Function
  +
'
  +
' Function to returns the folder name of the top/root folder, just below the namespace
  +
Public Function GetFolderRootName(objFolder As MAPIFolder) As String
  +
If Not objFolder.Parent.Class = olFolder Then
  +
GetFolderRootName = objFolder.Name
  +
Exit Function
  +
End If
  +
GetFolderRootName = GetFolderRootName(objFolder.Parent)
  +
End Function
  +
'
  +
' Function to return a folder (object) specified by a full folder path
  +
Public Function GetFolder(strFolderPath As String) As MAPIFolder
  +
  +
' folder path needs to be something like
  +
' "Public Folders\All Public Folders\Company\Sales"
  +
  +
Dim objApp As Outlook.Application
  +
Dim objNS As Outlook.NameSpace
  +
Dim colFolders As Outlook.Folders
  +
Dim objFolder As Outlook.MAPIFolder
  +
Dim arrFolders() As String
  +
Dim I As Long
  +
  +
On Error Resume Next
  +
  +
strFolderPath = Replace(strFolderPath, "/", "\")
  +
arrFolders() = Split(strFolderPath, "\")
  +
Set objApp = CreateObject("Outlook.Application")
  +
Set objNS = objApp.GetNamespace("MAPI")
  +
Set objFolder = objNS.Folders.Item(arrFolders(0))
  +
  +
If Not objFolder Is Nothing Then
  +
For I = 1 To UBound(arrFolders)
  +
Set colFolders = objFolder.Folders
  +
Set objFolder = Nothing
  +
Set objFolder = colFolders.Item(arrFolders(I))
  +
If objFolder Is Nothing Then
  +
Exit For
  +
End If
  +
Next
  +
End If
  +
  +
Set GetFolder = objFolder
  +
Set colFolders = Nothing
  +
Set objNS = Nothing
  +
Set objApp = Nothing
  +
End Function
  +
'
  +
' Function to create a folder specified by a full folder path
  +
Public Function CreateFolder(strFolderPath As String)
  +
  +
' folder path needs to be something like
  +
' "Public Folders\All Public Folders\Company\Sales"
  +
Dim objNS As Outlook.NameSpace
  +
Dim objApp As Application
  +
Dim objFolder As Outlook.MAPIFolder
  +
Dim colFolders As Outlook.Folders
  +
Dim arrFolders() As String
  +
  +
On Error Resume Next
  +
  +
' Some basic initialization, get app & namespace objects
  +
Set objApp = CreateObject("Outlook.Application")
  +
Set objNS = objApp.GetNamespace("MAPI")
  +
  +
' Build an array of folder names...
  +
strFolderPath = Replace(strFolderPath, "/", "\")
  +
strFolderPath = Replace(strFolderPath, "\\", "", 1, 1)
  +
arrFolders() = Split(strFolderPath, "\")
  +
Set objFolder = objNS.Folders.Item(arrFolders(0))
  +
  +
' Process folders
  +
If Not objFolder Is Nothing Then
  +
For I = 1 To UBound(arrFolders)
  +
Set colFolders = objFolder.Folders
  +
Set objFolder = Nothing
  +
Set objFolder = colFolders.Item(arrFolders(I))
  +
If objFolder Is Nothing Then
  +
colFolders.Add (arrFolders(I))
  +
Set objFolder = colFolders.Item(arrFolders(I))
  +
End If
  +
Next
  +
End If
  +
  +
Set colFolders = Nothing
  +
Set objNS = Nothing
  +
Set objApp = Nothing
  +
End Function
  +
</source>
  +
  +
<br>Inspiration sources:
  +
*http://www.outlookcode.com/codedetail.aspx?id=321
  +
*http://www.outlookcode.com/codedetail.aspx?id=714
  +
  +
==Interoperability between Exchange/Outlook & Linux==
  +
  +
===PST to Maildir===
   
 
* In Outlook:
 
* In Outlook:
Line 32: Line 513:
   
 
I tried the PST Import plugin v1.2 for Thunderbird but it failed finding any mail in the PST
 
I tried the PST Import plugin v1.2 for Thunderbird but it failed finding any mail in the PST
  +
==Openchange==
 
  +
'''Update''': have tried recently readpst from pst-utils, it can read directly Outlook 2007 password protected PST files.
  +
  +
===Openchange===
 
I tried the one from Debian Experimental (version 1.0~svn679-1)
 
I tried the one from Debian Experimental (version 1.0~svn679-1)
 
mapiprofile --address=A.B.C.D --username=name --password=passwd --domain=DOM --workstation=BLABLA --profile=test --create
 
mapiprofile --address=A.B.C.D --username=name --password=passwd --domain=DOM --workstation=BLABLA --profile=test --create
Line 38: Line 522:
   
 
I tried to compile the libmapi0 from the SVN, no segfault anymore but still failed
 
I tried to compile the libmapi0 from the SVN, no segfault anymore but still failed
  +
===Evolution===
  +
Apparently ther is an attempt to support MAPI in a development branch but it has too much recent dependencies for me to compile it...
  +
svn checkout http://svn.gnome.org/svn/evolution/branches/EXCHANGE_MAPI_BRANCH
  +
  +
svn diff http://svn.gnome.org/svn/evolution/trunk http://svn.gnome.org/svn/evolution/branches/EXCHANGE_MAPI_BRANCH
  +
==Interoperability between Outlook 2007 and GnuPG==
  +
  +
In reply to [http://www.terminally-incoherent.com/blog/2008/08/13/no-one-uses-gpg-with-outlook/ this recap post], David Cumps wrote [http://blog.cumps.be/gpg-in-outlook-2007-outlookgnupg a new plugin] for Outlook 2007.
  +
<br>From my personal experience, decrypting and verifying signature works, signing too but encrypting has a little glitch: the plugin doesn't find the list of recipients.
  +
<br>We're almost there!
  +
  +
Installation hint: initially I used gnupg 1.4.9 from cygwin but I had weird problems with the plugin. Installing the [ftp://ftp.gnupg.org/gcrypt/binary/gnupg-w32cli-1.4.9.exe stand-alone gnupg 1.4.9] solved those issues.

Latest revision as of 15:31, 22 September 2014

A page about Outlook on this wiki? Sounds weird isn't it?
Well, blame my employer.

We migrated from Lotus Notes, with crappy hacked outdated client so Outlook is still better but...
At least under Lotus Notes it was possible to add an IMAP account (BTW Lotus Notes crashed quite often when talking IMAP...)
Here: Tools->Account Settings->This feature has been disabled by your system administrator

References

Unlocking

Main registry keys

Apparently important registry keys are under:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook

Some tips here (french)

IMAP settings

We can remove the admin barrier on account management:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Setup\ModifyAccounts
=0

Another way without modifying the Registry is to use the import feature:
If e.g. Outlook Express client is also present on the Windows machine

  • In Outlook Express:
    • Wizard -> typed my IMAP&SMTP settings
  • In Outlook:
    • File -> Import and Export... -> Import Internet Mail Account Settings -> Microsoft Outlook Express or Microsoft Windows Mail -> Wizard allowing to edit the imported settings :-)
    • Then write a new mail -> Account (below Send button) -> select your new account -> Send test mail -> Prompted to choose the sent folder, ok -> you've a multiple tabs config view of your new account, possibility to switch servers to TLS, changing name of the account, saying you need auth to talk to your SMTP etc etc
    • If you need to tune IMAP settings later, go to registry and reset key (000000NN must be replaced with the number of your IMAP profile)
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\000000NN\IMAP Sentitems
= 0

Note that I also tried importing from Eudora Light & Eudora but Outlook didn't see anything

Access to accounts management can be also blocked slightly differently: if you can access accounts managemetn but cannot create e.g. a new IMAP account, it's because those account types are disabled selectively, e.g. you need to change:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\DisableIMAP
=0

or

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\DisableIMAP
=0

or

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\outlook\options\disableimap
=0

Cached Exchange Mode

The following keys were set in my configuration, preventing to change the settings related to Cached Exchange Mode. In particular the mode selection was disabled, ie. the options Download full items, Download headers and then full items, Download headers were all grayed out.

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
"CachedExchangeMode"=dword:00000001
"Enable"=dword:00000001
"NoDrizzle"=dword:00000001
"NoFullItems"=dword:00000001
"NoHeaders"=dword:00000000
"NoManualOnlineSync"=dword:00000001
"SyncPFFav"=dword:00000001

To unlock all settings, and eg. allow download full headers, simply delete values CachedExchangeMode, NoDrizzle, NoFullItems, NoHeaders, and NoManualOnlineSync (ie. all but Enable and SyncPFFav).

Changing JunkMail levels

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\Mail\JunkMailProtection
No Protection = 0xffffffff = 4294967295
Low = 6
High = 3
Trusted Lists Only = 0x80000000 = 2147483648

To enable the JunkMail otions in the Options->Preferences->E-Mail->Junk E-mail menu

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\DisableAntiSpam
=0

AutoArchive

Recently the function AutoArchive vanished from Outlook, don't panic! To enable AutoArchive in the Menu->File again just change the following registry value:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences\DisableManualArchive = 0

Changing this value is not sufficient to get access back the AutoArchive options. You need to delete the entire registry key Preferences. Not sure everything needs to go, but it does the work.

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences]

All in one registry file

You can also put all the above registry modifications in one single file [{{#file:Outlook.reg}} Outlook.reg]

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook]
"DisableAntiSpam"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
"NoFullItems"=-
"NoDrizzle"=-
"NoHeaders"=-
"CachedExchangeMode"=-
"NoManualOnlineSync"=-

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\Mail]
"JunkMailProtection"=-

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Setup]
"ModifyAccounts"=dword:00000000

;Take care of that one, it could delete more than intended...
[-HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Preferences]

...and modify the registry at each startup with the following command:

regedit /s Outlook.reg

Note: the hyphens after the registry value and in front of the registry key indicates respectively a request to delete the value and the entire key. See http://support.microsoft.com/kb/310516 for details.

Group Policy and other configuration hints

To use the Group Policy for Microsoft Outlook 2007 you may need to install the Outlook Group Policy template Outlk12.adm

  1. Copy the policy template Outlk12.adm into %WINDIR%\inf
  2. Open Group Policy Editor: Start-> Run-> gpedit.msc
  3. Add template:
    1. Select User Configuration
    2. Right-click on Administrative Templates
    3. Select Add/Remove properties-> Click Add button
    4. Browse to %WINDIR%\inf and select Outlk12.adm

iCalendar

Outlook does not handle correctly the iCal file (*.ics) with recurrent event.

Problem: when opening (eg.: double-click on the attachment) an iCal file with multiple events, ie. multiple VEVENT sections, Outlook tries to add a complete calendar. Your are prompted with a dialog box with the following question: Add this Internet Calendar to Outlook. It is probably not what you want. Most probably you just need to add the multiple events in your existing calendar.

The solution requires to save the iCal file on your hard drive and import it back using the import function.

  1. Save file as...
  2. File -> Import and Export...
  3. Select Import and iCalendar (*.ics) or vCalendar (.vcs)
  4. Browse and select your saved iCal file, done.

Solution source: https://events.sfu.ca/manual/en/iCalExporter.htm.

Moving PST location

cf this post

  1. Close Outlook.
  2. Open Control Panel -> Choose Mails -> Click on Data files.
  3. Select the Account name and check for the location of the PST file. Leave the window open.
  4. Open the folder containing the PST. Move the PST to the desired location.
  5. Do NOT rename the file - if you do Outlook creates a new file in the default location again.
  6. Switch to the Data Files window (as opened in Step 2) and double click on the PST file location.
  7. This displays an error window, Ignore the error, and point to the new location. Close the windows.
  8. Restart Outlook.
  9. Outlook may create a new PST in the default location again, delete it, in such a case.

Recovering PST password

Password protection of PST is terribly wrong.

Get PstPassword, a free Outlook PST Password Recovery, launch it and launch your PST, you'll get instantly a password, actuallt many passwords, and they will all work! How is it possible? Read this.

Note that McAfee detects the program as "Potentially Unwanted Program", a "Generic PUP.z":
McAfee(R) Avert™ recognizes that this program may have legitimate uses in contexts where an authorized administrator has knowingly installed this application
But still no question, the program is simply erased by McAfee.
One easy solution: open it under andLinux and run it with WINE :-)

Apparently this can work both on "compressible encryption" and "high encryption" types of PST.

Coping with enterprise backup policy

The policy states:

  • Original e-mail and 'unique copies' must be stored in the mailbox or in the Central Vault (a Symantec stuff for central storage).
  • Copies of original e-mail can be stored locally to support working offline for which the original is available in the mailbox or Central Vault.
  • Original e-mail is e-mail as it enters MS Outlook or Central Vault.
  • A 'unique copy' is an original e-mail that has been modified.
  • This policy applies to all mailboxes in MS Outlook and Central Vault.

So what we can do is:

  • Create a local .PST (or local IMAP) where you'll really archive your mails.
  • Don't create folders in the exchange mailbox but instead in your local .PST
  • In Exchange mailbox, only create a single folder called 'EV crap' or 'EV overload', or simply 'EV'
  • To archive a mail, you copy it from Exchange Inbox to your local .PST, then you move it to your 'EV' folder.
  • Every once in a while you go to your 'EV' folder, and you mass-send them to Enterprise Vault. Time to take a coffee break! (or two) (well, take a day off).

You can setup a rule to do this automatically

  • Go to Tools --> Rules and Alerts --> New Rules
  • Select Start from a blank rule / Check messages after sending, then click Next
  • Click Next again and confirm rules applies to all sent mails
  • Select "Move a copy to the specified folder"
  • Click on "specified", and create a new EV folder in your inbox for instance, select 'EV' folder. Click Next.
  • Click Next again (no exception)
    • or optionally you can add exception for private mails by e.g. selecting "except if the subject contains specific words"
    • Click on "specific words" and add your keywords, such as "private", "Private", "PRIVATE", etc
  • Give rule a name (eg. Auto EV sent message), click Finish.

You can do the same so that any incoming mail is automatically copied to given folder:

  • Go to Tools --> Rules and Alerts --> New Rules
  • Select Start from a blank rule / Check messages when they arrive, then click Next
  • Click Next again.
  • Select "Move a copy to the specified folder"
  • Click on "specified", and create a new EV folder in your inbox for instance, select 'EV' folder. Click Next.
  • Click Next again (no exception).
    • or optionally you can add exception for private mails by e.g. selecting "except if the subject contains specific words"
    • Click on "specific words" and add your keywords, such as "private", "Private", "PRIVATE", etc
  • Give rule a name (eg. Auto EV incoming message), click Finish.

With these 2 rules, you can continue archive your mails normally in the local PST (remember don't make folders in exchange account, it's useless). For compliance with EV policy, you only need to go once in a while to the EV folder, and mass send all mails there in EV.

Good luck!

Installing a local IMAP server on Windows

One possibility is uw-imap in Cygwin but if you want to use courier-imap, compilation under Cygwin is a nightmare... not anymore, see Courier-Cygwin
One easy way is to install courier-imap within AndLinux, e.g. following instructions at https://help.ubuntu.com/community/Courier

Macros

Installation

To install a macro:

  • Alt-F11 in Outlook
  • Open Project1 -> Microsoft Office Outlook Objects -> ThisOutlookSession (double-click)
  • copy/paste code
  • close & save

If required, allow unsigned macros:

  • Tools -> Macro -> Security -> Macro Security -> Warning for all macros

You'll have annoying popup at startup but there is no way around

Adding toolbar button to execute a Macro

  1. Create a new toolbar. Right-click on any Outlook toolbar and choose "Customize." From the Toolbars tab, hit the "New" button, and name your toolbar anything you want (like "my shortcuts"). Drag and drop your new toolbar to the top of Outlook to dock it next to your other toolbars.
  2. Add a Macro to your new toolbar. With the Customize dialog still open, go to its Commands tab. From the Commands tab, scroll down the Categories list, select Macros. In the Commands list select, drag and drop your Macro to your new toolbar.
  3. Customize your new shortcut/button. With the Customize dialog still open, go to its Commands tab. Click on the new button in the toolbar (not in the Customize dialog). The button Modify Selection in the Customize dialog is now enabled. Click on it to change multiple properties of your new toolbar button.

Solution source: http://lifehacker.com/381966/tweak-microsoft-outlook-to-empty-your-inbox-faster


Todo: add the macro in the right-click menu.

Send & Save

Lotus Notes can prompt the sender to specify what folder a message should be saved in. In Outlook, you can set the storage folder on the Options dialog. This VBA code reproduces something closer to the Notes behavior by popping up the Select Folder dialog when the user sends the message. (see here and there)
UPDATE: Avoid treating appointments as it fails.

Private Sub Application_ItemSend(ByVal Item As Object, _
    Cancel As Boolean)
  Dim objNS As NameSpace
  Dim objFolder As MAPIFolder
  Set objNS = Application.GetNamespace("MAPI")
  If TypeOf Item Is MailItem Then
    Set objFolder = objNS.PickFolder
    If TypeName(objFolder) <> "Nothing" Then
         Set Item.SaveSentMessageFolder = objFolder
    End If
  End If
  Set objFolder = Nothing
  Set objNS = Nothing
End Sub

If you don't want this pop-up all the time but to sort on casual base, you can use the built-in option:

  • While writing a new mail, select "Options" tab (not the "Options" toolbar) -> "Save Sent Item" button -> Other Folder -> Select

Move To Archive

Lotus Notes provided a way to archive mails manually. This feature is not supported by Outlook. To point is to select one or multiple mails in the inbox and move then with one single action to an archive folder. The following macro helps you to move mail into a dedicated archive folder (selected PST file + selected folder):
Note:You may need to change the name of the PST file ("Personal Folders") and the target folder ("Ancient Archive") according to your setup.

OBSOLETE: take a look at the macro Archive Now

Sub MoveToArchive()
On Error Resume Next
    Dim objFolder As Outlook.MAPIFolder
    Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem

    Set objNS = Application.GetNamespace("MAPI")
    Set objFolder = objNS.Folders("Personal Folders").Folders("Ancient Archive")
'Assume this is a mail folder
 
 
    If objFolder Is Nothing Then
        MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER"
    End If
 
 
    If Application.ActiveExplorer.Selection.Count = 0 Then
        'Require that this procedure be called only when a message is selected
        Exit Sub
    End If
 
    For Each objItem In Application.ActiveExplorer.Selection
        If objFolder.DefaultItemType = olMailItem Then
            If objItem.Class = olMail Then
                objItem.UnRead = False
                objItem.Move objFolder
            End If
        End If
    Next
 
    Set objItem = Nothing
    Set objFolder = Nothing
    Set objNS = Nothing
End Sub


Solution source: http://www.yeraze.com/article.php/outlook_macro_move_to_folder_mark_Read

Archive Now

The Archive Now macro better mimic the expected behavior of the Archive Selected Items of Lotus Notes (I never thought I would like to mimic anything from Lotus Notes,...) This Archive Now macro moves the selected mails, meetings and appointments (NEW) in the same sub-folder as its original location. Note that the archive operation does not depend on any time and date information. All selected mails, meetings and appointments will be archived/moved.
Note: you may need or want to change the destination name (ie: "Archive Folders")

' Routine/Macro to archive selected mails into given data file
Sub ArchiveNow()
    On Error Resume Next
    MoveToFolder ("Archive Folders")
End Sub
'
' Function to move selected mails into given data file
Public Function MoveToFolder(destName As String)
    Dim objNS As Outlook.NameSpace
    Dim objApp As Application
    Dim objFolder As Outlook.MAPIFolder
    Dim strCurrentFolderRootName As String
    Dim strDestinationFolderPath As String
    Dim objItem As Object
    
    On Error Resume Next

    ' Some basic initialization, get app & namespace objects
    Set objApp = CreateObject("Outlook.Application")
    Set objNS = objApp.GetNamespace("MAPI")
    
    ' Abort if nothing selected
    If objApp.ActiveExplorer.Selection.Count = 0 Then
        'Require that this procedure be called only when a message is selected
        Exit Function
    End If
    
    ' Abort if destination == source
    strCurrentFolderRootName = GetFolderRootName(objApp.ActiveExplorer.CurrentFolder)
    If strCurrentFolderRootName = destName Then
        ' Require that this procedure be called outside destination folder
        Exit Function
    End If
    
    ' Get destination folder path
    strDestinationFolderPath = Replace(objApp.ActiveExplorer.CurrentFolder.FolderPath, _
        "\\" + strCurrentFolderRootName, destName)
    
    ' Get destination folder object
    Set objFolder = GetFolder(strDestinationFolderPath)
    
    ' Check if destination folder exist, if not create it!
    If objFolder Is Nothing Then
        Dim Response
        Response = MsgBox("Folder '" + strDestinationFolderPath + "' does not exist. " + _
            "Do you want to create it?", vbYesNo + vbExclamation, "Folder not found")
        If Response = vbYes Then
            CreateFolder (strDestinationFolderPath)
            Set objFolder = GetFolder(strDestinationFolderPath)
            If objFolder Is Nothing Then
                MsgBox "The destination folder creation failed!", vbOKOnly + vbExclamation, "INVALID FOLDER"
                Exit Function
            End If
        Else
            Exit Function
        End If
    End If
    
    ' Move mails, meetings and appointments to destination folder
    For Each objItem In objApp.ActiveExplorer.Selection
        If objFolder.DefaultItemType = olMailItem Then
            ' Process Mail item
            If TypeOf objItem Is MailItem Then
                Dim objMailItem As Outlook.MailItem
                Set objMailItem = objItem
                objMailItem.UnRead = False
                objMailItem.Move objFolder
                Set objMailItem = Nothing
            End If
            ' Process Meeting item
            If TypeOf objItem Is MeetingItem Then
                Dim objMeetingItem As Outlook.MeetingItem
                Set objMeetingItem = objItem
                objMeetingItem.UnRead = False
                objMeetingItem.Move objFolder
                Set objMeetingItem = Nothing
            End If
            ' Process Appointment item - NOTE: not sure it will ever be necessary
            If TypeOf objItem Is AppointmentItem Then
                Dim objAppointItem As Outlook.AppointmentItem
                Set objAppointItem = objItem
                objAppointItem.UnRead = False
                objAppointItem.Move objFolder
                Set objAppointItem = Nothing
            End If
        End If
    Next
    
    Set objNS = Nothing
    Set objApp = Nothing
    Set objItem = Nothing
    Set objFolder = Nothing
End Function
'
' Function to returns the folder name of the top/root folder, just below the namespace
Public Function GetFolderRootName(objFolder As MAPIFolder) As String
    If Not objFolder.Parent.Class = olFolder Then
        GetFolderRootName = objFolder.Name
        Exit Function
    End If
    GetFolderRootName = GetFolderRootName(objFolder.Parent)
End Function
'
' Function to return a folder (object) specified by a full folder path
Public Function GetFolder(strFolderPath As String) As MAPIFolder

  ' folder path needs to be something like
  '   "Public Folders\All Public Folders\Company\Sales"

  Dim objApp As Outlook.Application
  Dim objNS As Outlook.NameSpace
  Dim colFolders As Outlook.Folders
  Dim objFolder As Outlook.MAPIFolder
  Dim arrFolders() As String
  Dim I As Long

  On Error Resume Next

  strFolderPath = Replace(strFolderPath, "/", "\")
  arrFolders() = Split(strFolderPath, "\")
  Set objApp = CreateObject("Outlook.Application")
  Set objNS = objApp.GetNamespace("MAPI")
  Set objFolder = objNS.Folders.Item(arrFolders(0))

  If Not objFolder Is Nothing Then
    For I = 1 To UBound(arrFolders)
      Set colFolders = objFolder.Folders
      Set objFolder = Nothing
      Set objFolder = colFolders.Item(arrFolders(I))
      If objFolder Is Nothing Then
        Exit For
      End If
    Next
  End If

  Set GetFolder = objFolder
  Set colFolders = Nothing
  Set objNS = Nothing
  Set objApp = Nothing
End Function
'
' Function to create a folder specified by a full folder path
Public Function CreateFolder(strFolderPath As String)

    ' folder path needs to be something like
    '   "Public Folders\All Public Folders\Company\Sales"
    Dim objNS As Outlook.NameSpace
    Dim objApp As Application
    Dim objFolder As Outlook.MAPIFolder
    Dim colFolders As Outlook.Folders
    Dim arrFolders() As String

    On Error Resume Next

    ' Some basic initialization, get app & namespace objects
    Set objApp = CreateObject("Outlook.Application")
    Set objNS = objApp.GetNamespace("MAPI")
    
    ' Build an array of folder names...
    strFolderPath = Replace(strFolderPath, "/", "\")
    strFolderPath = Replace(strFolderPath, "\\", "", 1, 1)
    arrFolders() = Split(strFolderPath, "\")
    Set objFolder = objNS.Folders.Item(arrFolders(0))
  
    ' Process folders
    If Not objFolder Is Nothing Then
        For I = 1 To UBound(arrFolders)
            Set colFolders = objFolder.Folders
            Set objFolder = Nothing
            Set objFolder = colFolders.Item(arrFolders(I))
            If objFolder Is Nothing Then
                colFolders.Add (arrFolders(I))
                Set objFolder = colFolders.Item(arrFolders(I))
            End If
        Next
    End If

    Set colFolders = Nothing
    Set objNS = Nothing
    Set objApp = Nothing
End Function


Inspiration sources:

Interoperability between Exchange/Outlook & Linux

PST to Maildir

  • In Outlook:
    • New -> Outlook Data File... -> Outlook 97-2002 Personal Folders file
    • Copy/Move mails to it
    • Right-Click on it -> Close it (probably safer)
  • In Linux:
    • Convert to mbox using readpst, then to Maildir using mb2md
mkdir pst
readpst -r -o pst backup.pst
find pst -name mbox -size 0 -exec rm {} \;
find pst -mindepth 2 -type d -print0|xargs --null -I XXX mb2md -s "$(pwd)/XXX/mbox" -
find pst -mindepth 2 -name mbox -print0|xargs --null rm

I tried the PST Import plugin v1.2 for Thunderbird but it failed finding any mail in the PST

Update: have tried recently readpst from pst-utils, it can read directly Outlook 2007 password protected PST files.

Openchange

I tried the one from Debian Experimental (version 1.0~svn679-1)

mapiprofile --address=A.B.C.D --username=name --password=passwd --domain=DOM --workstation=BLABLA --profile=test --create

-> segfault from libmapi0

I tried to compile the libmapi0 from the SVN, no segfault anymore but still failed

Evolution

Apparently ther is an attempt to support MAPI in a development branch but it has too much recent dependencies for me to compile it...

svn checkout http://svn.gnome.org/svn/evolution/branches/EXCHANGE_MAPI_BRANCH
svn diff http://svn.gnome.org/svn/evolution/trunk http://svn.gnome.org/svn/evolution/branches/EXCHANGE_MAPI_BRANCH

Interoperability between Outlook 2007 and GnuPG

In reply to this recap post, David Cumps wrote a new plugin for Outlook 2007.
From my personal experience, decrypting and verifying signature works, signing too but encrypting has a little glitch: the plugin doesn't find the list of recipients.
We're almost there!

Installation hint: initially I used gnupg 1.4.9 from cygwin but I had weird problems with the plugin. Installing the stand-alone gnupg 1.4.9 solved those issues.