Outlook: Difference between revisions

From miki
Jump to navigation Jump to search
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Links ==
* [http://www.howto-outlook.com/faq/outlook2013newandchanged.htm Outlook 2013, 36 tips]

== Miscellaneous ==
== Miscellaneous ==
* Summary of '''keyboard shortcuts''' can be found [https://kiwi.noekeon.org/miki/upload/Outlook%202007%20keyboard%20shortcut.xls here].
* Summary of '''keyboard shortcuts''' can be found [https://miki.immie.org/wiki/upload/Outlook%202007%20keyboard%20shortcut.xls here].

{| class="wikitable"
!Shortcut
!Description
!Custom
|-
|{{kb|C-q}}
|Mark as read
|
|-
|{{kb|C-S-v}}
|Move message
|
|}


== References ==
== References ==
Line 8: Line 25:
*** [http://go.microsoft.com/fwlink/?LinkID=94264 Group Policy overview 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]
** [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.
*** 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.
* ''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 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
* 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/].
* Folder with interesting policy settings on Outlook [http://theether.net/download/Microsoft/Office/2007/].
* [http://www.mapilab.com/outlook/security MAPILab - Advanced Security for Outlook - Outlook add-in for avoiding security alerts]<br/>An Add-in to debug message related to suspicious add-in (message like "A program is trying to access e-mail address information stored in Outlook...). This add-in provides the information not only about th type of alert, but also about what program caused it and makes it possible for the user to specify what status this program should have.


== Important Registry Keys ==
== Important Registry Keys ==
Line 18: Line 36:
<source lang="reg">
<source lang="reg">
[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook]
[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\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook]
</source>
</source>
Line 29: Line 47:
"ModifyAccounts"=dword:00000000
"ModifyAccounts"=dword:00000000
</source>
</source>
=== Cached Mode ===
=== Cached Exchange Mode ===
The following keys were set in my configuration, preventing to change the settings related to ''Cached Mode'' (in particular the selection between ''Download headers'', ''Download headers and then full items'', etc.):
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">
<source lang="reg">
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode]
"NoFullItems"=dword:00000001
"CachedExchangeMode"=dword:00000001
"SyncPFFav"=dword:00000001
"Enable"=dword:00000001
"NoDrizzle"=dword:00000001
"NoDrizzle"=dword:00000001
"NoFullItems"=dword:00000001
"NoHeaders"=dword:00000000
"NoHeaders"=dword:00000000
"Enable"=dword:00000001
"CachedExchangeMode"=dword:00000001
"NoManualOnlineSync"=dword:00000001
"NoManualOnlineSync"=dword:00000001
"SyncPFFav"=dword:00000001
</source>
</source>
To unlock all settings, simply delete all values but ''Enable''.
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'').


== Move <tt>.pst</tt> to another location ==
== Move <tt>.pst</tt> to another location ==

;Outlook 2007
Follow the simple procedure described [http://azcarya.blogspot.com/2008/02/gmail-outlook-2007-and-imap.html here]:
Follow the simple procedure described [http://azcarya.blogspot.com/2008/02/gmail-outlook-2007-and-imap.html here]:


Line 55: Line 75:
# Outlook may create a new PST in the default location again, delete it, in such a case.
# Outlook may create a new PST in the default location again, delete it, in such a case.
# Restart Outlook.
# Restart Outlook.

;Outlook 2010
Inspired from instructions at [http://office.microsoft.com/en-001/outlook-help/move-an-offline-outlook-data-file-ost-HA010378297.aspx].

To move the .OST file,
# Close Outlook, and move .OST file to desired location
# Open ''Outlook Data File Settings'' dialog (Control Panel &rarr; ''Mail'' &rarr; ''Data Files...'' &rarr; select exchange account &rarr; ''Settings...'' &rarr; ''Advanced...'' &rarr; ''Outlook Data File Settings'')
# Click ''Disable Offline Use'', and then click ''Yes''.
# Click ''Browse'', and select the .OST file at the new location, and click ''Open''.

If ''Disable Offline Use'' is grayed out, you first need to disable the ''Cached Exchange Mode''. For this,
# Open the ''Advanced'' pane in Microsoft Exchange account dialog (Control Panel &rarr; ''Mail'' &rarr; ''Data Files...'' &rarr; select exchange account &rarr; ''Settings...'' &rarr; ''Advanced...'').
# Uncheck the box ''Use Cached Exchange Mode'', and click ''Apply''.
# Don't forget to restore the ''Cached Exchange Mode'' afterwards.

Group policies might prevent disabling the cached exchange mode. In that case, you need to temporarily disable the policy.
# Open ''regedit'', and go to key <tt>HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Outlook\cached mode</tt>
# First export the key (''File &rarr; export...''), then delete the key to remove the policy.
# When .OST file is moved and cache Exchange Mode is restored, restore the policy by importing the .reg file generated during the previous step.
Note that by removing the policy this way, the ''Use Cached Exchange Mode'' box might already be cleared although the cached mode is still applied. In that case, just select the box, apply, and clear the box again.

;Outlook 2013 / 365
Yet another trick is needed. This time we need to create a new outlook profile [http://www.slipstick.com/exchange/moving-outlook-ost-file/], []

# Copy your .ost file to the new location. You can skip this step if you want to create a new .ost file.
# Open the '''Control panel''', find '''Mail'''.
# Click '''Show Profiles'''
# Click '''Add'''
# Type a name for your new profile, click OK
# Enter your username and password and let Outlook find your account information
# Select the '''Change account settings''' option, and then click '''Next'''
# Click '''More Settings'''.
# On the '''Advanced''' tab, click '''Outlook Data File Settings'''.
# Click '''Browse''', browse to the .ost file that you copied in step 1, and then click Open.
# If you want to create a new .ost file, browse to the new location, enter a filename, and then click Open. Outlook will create the new .ost file.
# OK your way back to the Mail profile dialog.
# Click '''Always use this profile''', select the new profile that you created, and then click OK to close the dialog.

==Macro==
===Installation===
To install a macro:
* Alt-F11 in Outlook
* '''Open''' ''Project1'' &rarr; ''Microsoft Office Outlook Objects'' &rarr; '''double-click''' ''ThisOutlookSession''
* copy/paste code
* close & save
If required, change the macro security settings:
* Tools &rarr; Macro &rarr; Security &rarr; Macro Security &rarr; '''Warning for all macros''' (You'll have an annoying popup at startup)
* Tools &rarr; Macro &rarr; Security &rarr; Macro Security &rarr; '''No security check for macros''' (no pop-up but since you'll always click yes anyway...)

In Outlook 2016:
* File &rarr; Options &rarr; Trust Center &rarr; Trust Center Settings &rarr; ...

===Send & Save===
Reference: [http://wiki.yobi.be/wiki/Outlook#Send_.26_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>
Install instruction (Outlook 2007):
* Press {{kb|Alt-F11}} to open MS Visual Basic.
* Locate on the left pane ''Project1 (VbaProject.OTM) &rarr; Microsoft Office Outlook Objects &rarr; ThisOutlookSession''. Double click on '''ThisOutlookSession'''
* '''Paste''' the code above, and '''close''' MS Visual Basic.
* '''Close and restart Outlook''' (you might want to change your macro policy)

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

=== Set Show Total Item Count for all folders recursively ===

* Reference [https://answers.microsoft.com/en-us/msoffice/forum/msoffice_outlook-msoffice_custom-mso_2016/show-total-number-of-items-make-it-so-for-all/f0826c4d-461e-49ae-be89-aeaac7d130dd]

# Press {{kb|Alt-F11}} to open VBA in Outlook.
# Click '''Insert > Module''', and paste code below.
# Press {{kb|F5}} and select the macro below.

<source lang="vb">
Sub ShowTotalInAllFolders()
Dim oStore As Outlook.Store
Dim oRoot As Outlook.Folder

On Error Resume Next

For Each oStore In Application.Session.Stores
Set oRoot = oStore.GetRootFolder
ShowTotalInFolders oRoot
Next
End Sub

Private Sub ShowTotalInFolders(ByVal Root As Outlook.Folder)
Dim oFolder As Outlook.Folder

On Error Resume Next

If Root.Folders.Count > 0 Then
For Each oFolder In Root.Folders
oFolder.ShowItemCount = olShowTotalItemCount
ShowTotalInFolders oFolder
Next
End If
End Sub
</source>

To compare with the content of an IMAP server Maildir, we have the oneliner:
<source lang=bash>
find Maildir -type d -name cur | while read F; do echo "$(($(ls -l "$F" | wc -l) - 1 )) -- $F"; done | sort -k 3 | column -t
</source>

== Export contacts to .VCF files ==
<source lang="vb">
'==========================================================
'== VB Script to Export Outlook Contacts to vCard (vcf) files
'==
'== Copyright © 2008, Dave Moats
'==
'== This sample is provided 'AS-IS', without any
'== express or implied warranty. In no event will the
'== authors be held liable for any damages arising from
'== the use of this sample code.
'==
'== Permission is granted to anyone to use this sample
'== code for any purpose, including commercial applications,
'== subject to the following restrictions:
'==
'== The origin of this code must not be misrepresented;
'== you must not claim that you wrote the original code.
'==
'== If you use this code, an acknowledgment in the
'== documentation is requested - shown below:
'==
'== Portions Copyright © 2008,
'== Dave Moats (http://www.davemoats.com/).
'==
'==========================================================

'==========================================================
'== NOTE: watch for wrapped lines and html special
'== characters in the web representation of this
'== sample code
'==========================================================

'==========================================================
'==
'== exportContacts.vbs - a script used to export contacts
'== from outlook and save them in
'== vcf format
'==========================================================
option explicit

'==========================================================
'== declare the local variables to be used
'==========================================================
dim scriptName, namedArgs, folderPath

'==========================================================
'== get the name of the running script
'==========================================================
scriptName = wscript.scriptname

'==========================================================
'== get the named command line arguments
'==========================================================
set namedArgs = wscript.arguments.named

if not namedArgs.exists("p") then
wscript.echo "Usage: " & scriptName & " /p:<output folder path> is required"
wscript.echo "Example: cscript " & scriptName & " /p:c:\path to the folder"
wscript.quit
else
folderPath = namedArgs.item("p")
end if

set namedArgs = nothing

'==========================================================
'== now call the subroutine that does all the work
'==========================================================
exportToVCF folderPath, ".vcf"

wscript.quit

'==========================================================
'== sub exportToVCF - subroutine that connects to outlook
'== and exports all contacts to the path
'== specified in the exportPath argument
'==========================================================
sub exportToVCF(exportPath, ext)
'======================================================
'== declare the local variables
'======================================================
dim outApp, fldContacts, contactEntry, exp

'======================================================
'== create the outlook object and then get the contacts
'======================================================
set outApp = createobject("Outlook.Application")


'======================================================
'== FIXME : put fold and subfolder structure here
'======================================================
set fldContacts = outApp.getnamespace("MAPI").folders("Personal Folders").folders("Sync2Mobile")

'======================================================
'== here we are looping the entries in the contacts
'== folder looking for contacts - when a contact is
'== found it will be exported
'======================================================
for each contactEntry in fldContacts.items

if typename(contactEntry) = "ContactItem" then

dim tmpString, tmpArr, periodLocation, outPath

tmpString = contactEntry.FileAs
'================================================
'== creating the name of the vcf file based on
'== the first and last name fields of the contact
'================================================
tmpString = replace( tmpString, "'", "" )
tmpString = replace( tmpString, "<", "" )
tmpString = replace( tmpString, ">", "" )
tmpString = replace( tmpString, ":", "" )
tmpString = replace( tmpString, """", "" )
tmpString = replace( tmpString, "/", "" )
tmpString = replace( tmpString, "\", "" )
tmpString = replace( tmpString, "|", "" )
tmpString = replace( tmpString, "?", "" )
tmpString = replace( tmpString, "*", "" )

tmpArr = split( tmpString, "," )

if ubound( tmpArr ) <> 1 then
wscript.echo tmpString & ext
outPath = exportPath & "\" & tmpString & ext
else
if tmpArr(0) = "com" then
wscript.echo trim(tmpArr(1)) & trim(tmpArr(0)) & ext
outPath = exportPath & "\" & trim(tmpArr(1)) & trim(tmpArr(0)) & ext
else
wscript.echo trim(tmpArr(1)) & " " & trim(tmpArr(0)) & ext
outPath = exportPath & "\" & trim(tmpArr(1)) & " " & trim(tmpArr(0)) & ext
end if
end if
contactEntry.saveas outPath, 6

end if
next
'======================================================
'== dumping the object references that were created
'======================================================
set fldContacts = nothing
set outApp = nothing

end sub
</source>

== Troubleshooting ==
=== Empty encrypted mails ===
'''{{red|UPDATE}}''' &mdash; See my new script <code>decryptmaildir.sh</code>. Modified by Phil Teuwen to use the excellent mail parsing utility <code>formail</code> (from ''procmail'' package).


Sometimes Outlook encrypted mails saved to an IMAP folder can appear empty. This can be fixed by editing the mail raw content as indicated below.

{|
|- valign=top
|Incorrect mail format:

From: "ABC" <abc@serv.com>
To: "ABC" <abc@serv.com>
Subject: Hello World
Date: Tue, 22 Oct 2013 11:01:19 +0100
MIME-Version: 1.0
<font color=red>Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0458_01CECF1E.6FCF53F0"</font>
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us
<font color=red>This is a multipart message in MIME format.
------=_NextPart_000_0458_01CECF1E.6FCF53F0
Content-Type: text/plain;
name="smime.p7m"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="smime.p7m"</font>
<font color=red>------=_NextPart_000_0458_01CECF1E.6FCF53F0</font>
<font color=blue>Content-Type: application/pkcs7-mime;
name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="smime.p7m"</font>
MIAGCSqGSIb3DQEHA6CAMIACAQAxgg4qMIH2AgEAMF8wUTETMBEGCgmSJomT8ixkARkWA2NvbTET
MBEGCgmSJomT8ixkARkWA254cDETMBEGCgmSJomT8ixkARkWA3diaTEQMA4GA1UEAxMHRU1FQS1D
[...]
ISw2YHqPUmKXYrgAAAAAAAAAAAAA
<font color=red>------=_NextPart_000_0458_01CECF1E.6FCF53F0--</font>

|Corrected format ({{red|deleted}}, {{blue|moved}})

From: "ABC" <abc@serv.com>
To: "ABC" <abc@serv.com>
Subject: Hello World
Date: Tue, 22 Oct 2013 11:01:19 +0100
MIME-Version: 1.0
<font color=blue>Content-Type: application/pkcs7-mime;
name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="smime.p7m"</font>
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us
MIAGCSqGSIb3DQEHA6CAMIACAQAxgg4qMIH2AgEAMF8wUTETMBEGCgmSJomT8ixkARkWA2NvbTET
MBEGCgmSJomT8ixkARkWA254cDETMBEGCgmSJomT8ixkARkWA3diaTEQMA4GA1UEAxMHRU1FQS1D
[...]
ISw2YHqPUmKXYrgAAAAAAAAAAAAA
|}

Here a small script to fix mails.

<source lang=bash>
#! /bin/bash

function single() { A=${1%//}; echo ${A%/}/; }

set -u -e # Forbid uninitialized vars, exit on error

SRC=$1
DST=$2

if [ -z "$SRC" -o -z "$DST" ]; then
echo "Usage: $(basename $0) srcfile dstfile"
exit 1
fi

if [ -a "$DST" -a -d "$DST" ]; then
DST=$(single $DST)$(basename $SRC)
fi

touch "$DST" || { echo "Can't write to $DST"; exit 1; }

# BOUNDARY=$(perl -lne 'print for /boundary="(----=.*)"/g' $SRC)

sed -rn "1,/^MIME-Version/p" "$SRC" > "$DST"
cat <<__EOF__ >> "$DST"
Content-Type: application/pkcs7-mime;
name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="smime.p7m"
__EOF__
sed -rn "/^X-Mailer/,/^$/p" "$SRC" >> "$DST"
sed -rn '/^[A-Za-Z0-9+\/=]{64}/,/^$/{/^$/!p}' "$SRC" >> "$DST"
</source>

=== Outlook 2010 removes + from mobile numbers ===
The fix is to configure '''dialing rules''' (in '''Control Panel''' &rarr; '''Phone and Modem'''), so that outlook accepts pluses ('+') in phone numbers (from [http://superuser.com/questions/367299/outlook-2010-removes-from-mobile-numbers]).

=== Disable Windows Search ===
See [https://social.technet.microsoft.com/Forums/ie/en-US/06cc4355-0763-4702-8bcf-8ee1548c7de3/outlook-search-issue-after-installing-june-2017-security-updates?forum=outlook technet.microsoft.com]. This fixes the following messages:

Something went wrong and your search couldn’t be completed.
Search results may be incomplete because items are still being indexed.

<source lang=regedit>
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"PreventIndexingOutlook"=dword:00000001
</source>

=== Fix online status not showing in Outlook ===
If the online status of contacts are no longer showing in Outlook, make sure that the IM Provider is correctly set in registry [https://techcommunity.microsoft.com/t5/microsoft-teams/display-online-status-next-to-name-in-outlook-greyed-out/m-p/730571]:

<source lang=regedit>
HKEY_CURRENT_USER\Software\IM Providers]
"DefaultIMApp"="Lync"
</source>

=== Configure IMAP account on Office 365 ===
In some configuration, the settings are not available in Office 365.

To configure the IMAP accounts:
* Open '''Control Panel'''.
* In search box, search for <code>mail</code>.
* Control Panel must return an entry called '''Mail (Microsoft Outlook) (32-bit)'''.

== Outlook Tips of the Week ==
Some tips to propose for the Outlook Tips of the Week:

* Adapting size of picture in Outlook (tryp with .bmp / .png)
* Check link from RMe [http://office.microsoft.com/en-us/outlook/HA100309761033.aspx?pid=CH102499821033#4]
* Udate save sent macro to also cope with appointment
* Archive macro from Thierry
* Move to folder context-menu and button
* Add PST tasks to To-Do List
:Right click on the personal folder file in Outlook, &rarr; properties, then select option "add this folder task &amp; follow-up to To-Do List machin brol"
* Create auto filtering rule from mail
* Move to folder &rarr; in folder view, can type the name of folder to quick find (then ENTER)
* Check Yobi for more tips
* Disable CTRL-Enter shortcut for send mail (in File &rarr; Options).

=== Use Tighter Spacing ===
* In '''View > Layout > Use Tighter Spacing''', to show more messages in the message pane.

Latest revision as of 11:56, 5 May 2022

Links

Miscellaneous

  • Summary of keyboard shortcuts can be found here.
Shortcut Description Custom
C-q Mark as read
C-S-v Move message

References

Important 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]
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook]

Unlocking

Account Settings

To unlock access to Account Settings (error "This feature has been disabled by your system administrator"), the following registry key must be set to 0 (for Outlook 2003/2007):

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

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).

Move .pst to another location

Outlook 2007

Follow the simple procedure described here:

  1. Open Outlook - Configure your GMail account as detailed here. Stop 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. Outlook displays an error window, Ignore the error, and point to the new location. Close the windows.
  8. Outlook may create a new PST in the default location again, delete it, in such a case.
  9. Restart Outlook.
Outlook 2010

Inspired from instructions at [2].

To move the .OST file,

  1. Close Outlook, and move .OST file to desired location
  2. Open Outlook Data File Settings dialog (Control Panel → MailData Files... → select exchange account → Settings...Advanced...Outlook Data File Settings)
  3. Click Disable Offline Use, and then click Yes.
  4. Click Browse, and select the .OST file at the new location, and click Open.

If Disable Offline Use is grayed out, you first need to disable the Cached Exchange Mode. For this,

  1. Open the Advanced pane in Microsoft Exchange account dialog (Control Panel → MailData Files... → select exchange account → Settings...Advanced...).
  2. Uncheck the box Use Cached Exchange Mode, and click Apply.
  3. Don't forget to restore the Cached Exchange Mode afterwards.

Group policies might prevent disabling the cached exchange mode. In that case, you need to temporarily disable the policy.

  1. Open regedit, and go to key HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Outlook\cached mode
  2. First export the key (File → export...), then delete the key to remove the policy.
  3. When .OST file is moved and cache Exchange Mode is restored, restore the policy by importing the .reg file generated during the previous step.

Note that by removing the policy this way, the Use Cached Exchange Mode box might already be cleared although the cached mode is still applied. In that case, just select the box, apply, and clear the box again.

Outlook 2013 / 365

Yet another trick is needed. This time we need to create a new outlook profile [3], []

  1. Copy your .ost file to the new location. You can skip this step if you want to create a new .ost file.
  2. Open the Control panel, find Mail.
  3. Click Show Profiles
  4. Click Add
  5. Type a name for your new profile, click OK
  6. Enter your username and password and let Outlook find your account information
  7. Select the Change account settings option, and then click Next
  8. Click More Settings.
  9. On the Advanced tab, click Outlook Data File Settings.
  10. Click Browse, browse to the .ost file that you copied in step 1, and then click Open.
  11. If you want to create a new .ost file, browse to the new location, enter a filename, and then click Open. Outlook will create the new .ost file.
  12. OK your way back to the Mail profile dialog.
  13. Click Always use this profile, select the new profile that you created, and then click OK to close the dialog.

Macro

Installation

To install a macro:

  • Alt-F11 in Outlook
  • Open Project1Microsoft Office Outlook Objectsdouble-click ThisOutlookSession
  • copy/paste code
  • close & save

If required, change the macro security settings:

  • Tools → Macro → Security → Macro Security → Warning for all macros (You'll have an annoying popup at startup)
  • Tools → Macro → Security → Macro Security → No security check for macros (no pop-up but since you'll always click yes anyway...)

In Outlook 2016:

  • File → Options → Trust Center → Trust Center Settings → ...

Send & Save

Reference: [4]

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

Install instruction (Outlook 2007):

  • Press Alt-F11 to open MS Visual Basic.
  • Locate on the left pane Project1 (VbaProject.OTM) → Microsoft Office Outlook Objects → ThisOutlookSession. Double click on ThisOutlookSession
  • Paste the code above, and close MS Visual Basic.
  • Close and restart Outlook (you might want to change your macro policy)

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

Set Show Total Item Count for all folders recursively

  1. Press Alt-F11 to open VBA in Outlook.
  2. Click Insert > Module, and paste code below.
  3. Press F5 and select the macro below.
Sub ShowTotalInAllFolders()
Dim oStore As Outlook.Store
Dim oRoot As Outlook.Folder

On Error Resume Next

For Each oStore In Application.Session.Stores
Set oRoot = oStore.GetRootFolder
ShowTotalInFolders oRoot
Next
End Sub

Private Sub ShowTotalInFolders(ByVal Root As Outlook.Folder)
Dim oFolder As Outlook.Folder

On Error Resume Next

If Root.Folders.Count > 0 Then
For Each oFolder In Root.Folders
oFolder.ShowItemCount = olShowTotalItemCount
ShowTotalInFolders oFolder
Next
End If
End Sub

To compare with the content of an IMAP server Maildir, we have the oneliner:

find Maildir -type d -name cur | while read F; do echo "$(($(ls -l "$F" | wc -l) - 1 ))  -- $F"; done | sort -k 3 | column -t

Export contacts to .VCF files

'==========================================================
'==     VB Script to Export Outlook Contacts to vCard (vcf) files
'==
'==           Copyright © 2008, Dave Moats
'==
'== This sample is provided 'AS-IS', without any
'== express or implied warranty. In no event will the
'== authors be held liable for any damages arising from
'== the use of this sample code.
'==
'== Permission is granted to anyone to use this sample
'== code for any purpose, including commercial applications,
'== subject to the following restrictions:
'==
'== The origin of this code must not be misrepresented;
'== you must not claim that you wrote the original code.
'==
'== If you use this code, an acknowledgment in the
'== documentation is requested - shown below:
'==
'==             Portions Copyright © 2008,
'==        Dave Moats (http://www.davemoats.com/).
'==
'==========================================================

'==========================================================
'== NOTE: watch for wrapped lines and html special
'==        characters in the web representation of this
'==        sample code
'==========================================================

'==========================================================
'==
'== exportContacts.vbs - a script used to export contacts
'==                        from outlook and save them in
'==                        vcf format
'==========================================================
option explicit

'==========================================================
'== declare the local variables to be used
'==========================================================
dim scriptName, namedArgs, folderPath

'==========================================================
'== get the name of the running script
'==========================================================
scriptName = wscript.scriptname

'==========================================================
'== get the named command line arguments
'==========================================================
set namedArgs = wscript.arguments.named

if not namedArgs.exists("p") then
   wscript.echo "Usage: " & scriptName & " /p:<output folder path> is required"
   wscript.echo "Example: cscript " & scriptName & " /p:c:\path to the folder"
   wscript.quit
else
   folderPath = namedArgs.item("p")
end if

set namedArgs = nothing

'==========================================================
'== now call the subroutine that does all the work
'==========================================================
exportToVCF folderPath, ".vcf"

wscript.quit

'==========================================================
'== sub exportToVCF - subroutine that connects to outlook
'==                   and exports all contacts to the path
'==                   specified in the exportPath argument
'==========================================================
sub exportToVCF(exportPath, ext)
   
    '======================================================
    '== declare the local variables
    '======================================================
    dim outApp, fldContacts, contactEntry, exp

    '======================================================
    '== create the outlook object and then get the contacts
    '======================================================
    set outApp = createobject("Outlook.Application")


    '======================================================
    '== FIXME : put fold and subfolder structure here
    '======================================================
    set fldContacts = outApp.getnamespace("MAPI").folders("Personal Folders").folders("Sync2Mobile")

    '======================================================
    '== here we are looping the entries in the contacts
    '== folder looking for contacts - when a contact is
    '== found it will be exported
    '======================================================
    for each contactEntry in fldContacts.items

       if typename(contactEntry) = "ContactItem" then

          dim tmpString, tmpArr, periodLocation, outPath

          tmpString = contactEntry.FileAs
         
          '================================================
          '== creating the name of the vcf file based on
          '== the first and last name fields of the contact
          '================================================
          tmpString = replace( tmpString, "'", "" )
          tmpString = replace( tmpString, "<", "" )
          tmpString = replace( tmpString, ">", "" )
          tmpString = replace( tmpString, ":", "" )
          tmpString = replace( tmpString, """", "" )
          tmpString = replace( tmpString, "/", "" )
          tmpString = replace( tmpString, "\", "" )
          tmpString = replace( tmpString, "|", "" )
          tmpString = replace( tmpString, "?", "" )
          tmpString = replace( tmpString, "*", "" )

          tmpArr = split( tmpString, "," )

          if ubound( tmpArr ) <> 1 then
             wscript.echo tmpString & ext
             outPath = exportPath & "\" & tmpString & ext
          else
             if tmpArr(0) = "com" then
                wscript.echo trim(tmpArr(1)) & trim(tmpArr(0)) & ext
                outPath = exportPath & "\" & trim(tmpArr(1)) & trim(tmpArr(0)) & ext
             else
                wscript.echo trim(tmpArr(1)) & " " & trim(tmpArr(0)) & ext
                outPath = exportPath & "\" & trim(tmpArr(1)) & " " & trim(tmpArr(0)) & ext
             end if
          end if
         
          contactEntry.saveas outPath, 6

       end if
    next
   
    '======================================================
    '== dumping the object references that were created
    '======================================================
    set fldContacts = nothing
    set outApp = nothing

end sub

Troubleshooting

Empty encrypted mails

UPDATE — See my new script decryptmaildir.sh. Modified by Phil Teuwen to use the excellent mail parsing utility formail (from procmail package).


Sometimes Outlook encrypted mails saved to an IMAP folder can appear empty. This can be fixed by editing the mail raw content as indicated below.

Incorrect mail format:
From: "ABC" <abc@serv.com>
To: "ABC" <abc@serv.com>
Subject: Hello World 
Date: Tue, 22 Oct 2013 11:01:19 +0100
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0458_01CECF1E.6FCF53F0"
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us

This is a multipart message in MIME format.

------=_NextPart_000_0458_01CECF1E.6FCF53F0
Content-Type: text/plain;
	name="smime.p7m"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="smime.p7m"


------=_NextPart_000_0458_01CECF1E.6FCF53F0
Content-Type: application/pkcs7-mime;
	name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="smime.p7m"

MIAGCSqGSIb3DQEHA6CAMIACAQAxgg4qMIH2AgEAMF8wUTETMBEGCgmSJomT8ixkARkWA2NvbTET
MBEGCgmSJomT8ixkARkWA254cDETMBEGCgmSJomT8ixkARkWA3diaTEQMA4GA1UEAxMHRU1FQS1D

[...]

ISw2YHqPUmKXYrgAAAAAAAAAAAAA

------=_NextPart_000_0458_01CECF1E.6FCF53F0--
Corrected format (deleted, moved)
From: "ABC" <abc@serv.com>
To: "ABC" <abc@serv.com>
Subject: Hello World 
Date: Tue, 22 Oct 2013 11:01:19 +0100
MIME-Version: 1.0
Content-Type: application/pkcs7-mime;
	name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="smime.p7m"
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us

MIAGCSqGSIb3DQEHA6CAMIACAQAxgg4qMIH2AgEAMF8wUTETMBEGCgmSJomT8ixkARkWA2NvbTET
MBEGCgmSJomT8ixkARkWA254cDETMBEGCgmSJomT8ixkARkWA3diaTEQMA4GA1UEAxMHRU1FQS1D

[...]

ISw2YHqPUmKXYrgAAAAAAAAAAAAA

Here a small script to fix mails.

#! /bin/bash

function single() { A=${1%//}; echo ${A%/}/; }

set -u -e                       # Forbid uninitialized vars, exit on error

SRC=$1
DST=$2

if [ -z "$SRC" -o -z "$DST" ]; then
    echo "Usage: $(basename $0) srcfile dstfile"
    exit 1
fi

if [ -a "$DST" -a -d "$DST" ]; then
    DST=$(single $DST)$(basename $SRC)
fi

touch "$DST" || { echo "Can't write to $DST"; exit 1; }

# BOUNDARY=$(perl -lne 'print for /boundary="(----=.*)"/g' $SRC)

sed -rn "1,/^MIME-Version/p" "$SRC" > "$DST"
cat <<__EOF__ >> "$DST"
Content-Type: application/pkcs7-mime;
	name="smime.p7m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="smime.p7m"
__EOF__
sed -rn "/^X-Mailer/,/^$/p" "$SRC" >> "$DST"
sed -rn '/^[A-Za-Z0-9+\/=]{64}/,/^$/{/^$/!p}' "$SRC" >> "$DST"

Outlook 2010 removes + from mobile numbers

The fix is to configure dialing rules (in Control PanelPhone and Modem), so that outlook accepts pluses ('+') in phone numbers (from [6]).

Disable Windows Search

See technet.microsoft.com. This fixes the following messages:

Something went wrong and your search couldn’t be completed.
Search results may be incomplete because items are still being indexed.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"PreventIndexingOutlook"=dword:00000001

Fix online status not showing in Outlook

If the online status of contacts are no longer showing in Outlook, make sure that the IM Provider is correctly set in registry [7]:

HKEY_CURRENT_USER\Software\IM Providers]
"DefaultIMApp"="Lync"

Configure IMAP account on Office 365

In some configuration, the settings are not available in Office 365.

To configure the IMAP accounts:

  • Open Control Panel.
  • In search box, search for mail.
  • Control Panel must return an entry called Mail (Microsoft Outlook) (32-bit).

Outlook Tips of the Week

Some tips to propose for the Outlook Tips of the Week:

  • Adapting size of picture in Outlook (tryp with .bmp / .png)
  • Check link from RMe [8]
  • Udate save sent macro to also cope with appointment
  • Archive macro from Thierry
  • Move to folder context-menu and button
  • Add PST tasks to To-Do List
Right click on the personal folder file in Outlook, → properties, then select option "add this folder task & follow-up to To-Do List machin brol"
  • Create auto filtering rule from mail
  • Move to folder → in folder view, can type the name of folder to quick find (then ENTER)
  • Check Yobi for more tips
  • Disable CTRL-Enter shortcut for send mail (in File → Options).

Use Tighter Spacing

  • In View > Layout > Use Tighter Spacing, to show more messages in the message pane.