December 18, 2009

Launch Outlook Email

Surround SCM

Works with Surround SCM 2010 and later

Will not work with Surround SCM 2009 and earlier

Some time ago, I posted an example on how to use Surround SCM triggers in conjunction with the workflow to email a file in your local working directory. While the solution was nice in that it involved the workflow, it was very cumbersome to set up and configure. This plug in sample simplifies the process and uses the Outlook Interop interface to launch an Outlook message with the local file attached.

Use Case

Your process dictates that before you check in a file (or files), you must have someone else review it before you can check it in. The file is in your working directory, so how do you get this individual to review your file? For some of you, email is the answer. You open your mail client, and attach the files from your working directory. While the "Open Containing Folder" feature in the Surround SCM client makes this easier, it still involves several steps. This tool aims to simplify this process even further. When you right click on a file (or files), the tool will call Outlook and create a new mail item and automatically attach the local copy of the file.

Access from Surround SCM client

Please refer to the Surround SCM Custom Client Menus article for help on creating a custom menu option to access the tool. It is meant to be used as a plugin and will not work otherwise. While the tool maybe accessed from anywhere, remember that it requires at least one file to be selected, so it makes sense that it should be accessed from the file context menu.

Requirements

  • The tool depends on at least one file being selected in the Surround SCM client.
  • The tool requires that you have a working directory set and it contains a copy of the selected file.
  • This was created and tested against Outlook 2007.
  • The tool was written using Visual Studio 2008, so the .NET framework version 3.5 must be present.
  • You must have Outlook open to run this. I'm sure code could be added to open Outlook if not open, but this is just a sample. Feel free to add code as needed.
  • The tool supports working directories that start with double back slashes (\sharefoldername) and with a mapped letter drive (c:localfolder).

Download

There are two versions of this tool. The first one will only work with version 2010.0.0. The other one works with every version that came afterwards (starting with 2010.0.x).

2010.0.0 version

You can dowload the tool and the Visual Studio 2008 project from here.

2010.0.x version

You can download the tool and the Visual Studio 2008 project from here.

Outlook Security Issue

When the tool attempts to launch Outlook, you may get the window shown in the image below.

Outlook prompt

The following article from Microsoft provides some instructions on how to deal with this message: http://office.microsoft.com/en-us/orkXP/HA011364471033.aspx

Don't use Outlook?

Unfortunately, this will only work with Outlook. If you use a different mail client this should at least give you guidance in how to handle the Surround SCM part of this, namely, how to hande the environment variables made avaiable via the plug in architecture. There is an example on how to launch Apple Mail1. If you would like to drop me a note, I'll keep tally on the most popular mail client besides Outlook and might post an example using that client as well. Chances are I will not have access to that mail client, so a big emphazis on the work might.