Outlook: Difference between revisions
Line 90: | Line 90: | ||
If you don't want this pop-up all the time but to sort on casual base, you can use the built-in option: |
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 |
* While writing a new mail, select "Options" tab (not the "Options" toolbar) -> "Save Sent Item" button -> Other Folder -> Select |
||
== 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> |
Revision as of 12:02, 9 June 2010
Miscellaneous
- Summary of keyboard shortcuts can be found here.
References
- Microsoft Office 2007 Resource Kit (official documentation from Microsoft)
- Documentation page
- Administrative template (ADM,ADMX,...) files
- Use 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 Google Books.
- Excellent 3rd party page on Outlook policy: http://www.howto-outlook.com/howto/policies.htm
- Folder with interesting policy settings on Outlook [1].
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
Follow the simple procedure described here:
- Open Outlook - Configure your GMail account as detailed here. Stop 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.
- Outlook displays an error window, Ignore the error, and point to the new location. Close the windows.
- Outlook may create a new PST in the default location again, delete it, in such a case.
- Restart Outlook.
Macro
Installation
To install a macro:
- Alt-F11 in Outlook
- Open Project1 → Microsoft Office Outlook Objects → double-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...)
Send & Save
Reference: [2]
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
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