Skip to content

Outlook integration

bsag edited this page Jul 16, 2011 · 1 revision

Microsoft Outlook/Tracks Integration

Features

  • Create a new Tracks todo directly from Microsoft Outlook.
  • Inserts an ‘Add to Tracks’ option in the right-click context menu for email items.
  • A popup dialog box allows the context and project of the item to be set.
  • Uses the RESTful API.

Requirements:

Outlook 2003 (tested).
Outlook 2007 (tested).

Todo:

Due By/Show From

Author

Greg Jarman.

I’m not a VBA coder – No guarantees on this software. I hope it works for you.

Installation:

Download Required Files

1. Download the file: [url=http://www.users.on.net/~greg_jarman/TodoForm10.zip]TodoForm10.zip[/url]. Unzip the contents to a temporary directory – which can be removed after the import in the next step.

User Form Creation

2. Open Outlook. Go to the Tools menu, select Macro→Visual Basic Editor.
3. The Virtual Basic Editor will open.
4. Select File→Import…
5. Import the TodoForm.frm file.
6. Verify that you have a new item created under the Forms folder in your Project window.

User Form Configuration

7. From the Project box, expand Forms.
8. Right-click TodoForm and select View Code.
9. Edit the file and set appropriate values for the following things:

  • sURL: The address of your tracks installation.
  • sUsername: Your tracks username.
  • sPassword: Your tracks password.
  • sProxy: If required, configure the address and port of your proxy server. Otherwise, leave it blank.

Outlook Integration

10. Still in Visual Basic: From the Project box, expand “Microsoft Office Outlook” to find “ThisOutlookSession”.
11. Right-click ThisOutlookSession and select “View Code”.
12. If you have anything existing in there called ‘Private Sub Application_Startup()’ STOP NOW and seek expert advice. Continuing may interrupt access to pre-existing customisations already present in your Oulook configuration.
13. Otherwise, copy and paste the following into the Window:

[pre]

’ greg jarman 20080821 v1.0 initial version

Option Explicit

Private WithEvents explorer As Outlook.explorer
Private WithEvents mailItem As Outlook.mailItem

Const MENUITEM_TEXT = “Add To Tracks…”

Private Sub Application_Startup()
’ CheckLibrary

Set explorer = Application.ActiveExplorer Application.ActiveExplorer

End Sub

Public Sub mailItem_CustomAction(ByVal Action As Object, _
ByVal Response As Object, ByRef Cancel As Boolean)
Select Case Action.Name
Case MENUITEM_TEXT
TodoForm.DescriptionTextBox.Text = mailItem.Subject
TodoForm.NotesTextBox.Text = mailItem.Body
TodoForm.Show
Cancel = True
Case Else
End Select
End Sub

Private Sub explorer_SelectionChange()
Dim selectedItem As Object

For Each selectedItem In explorer.Selection If selectedItem.Class = olMail Then Dim newAction As Outlook.Action Set mailItem = selectedItem Set newAction = mailItem.Actions.Item(MENUITEM_TEXT) If newAction Is Nothing Then Set newAction = mailItem.Actions.Add newAction.Name = MENUITEM_TEXT newAction.ShowOn = Outlook.OlActionShowOn.olMenu newAction.Enabled = True mailItem.Save End If End If Next

End Sub
[/pre]

Outlook Macro Security

14. Close the Visual Basic editor window.
15. From the main Outlook menu, select Tools→Macro→Security. Ensure the Security Level setting is on Medium. You’ll be prompted when a macro wishes to run, see below for an optional change to remove this warning.

Testing Outlook Integration

16. Close Outlook and reopen it.
17. Select Enable Macro to allow the Tracks macro to start up.
18. Right click a mail message and select ‘Add To Tracks…’
19. Edit the fields, and hit ‘Add Todo’
20. Verify the new item is visible in your Tracks browser interface.

Self-signing the Macro

It is possible to sign the VBA code in order to prevent the Macro Security warning popups whenever you start Outlook. This section is optional – the functionality of the addon is not otherwise enhanced by this change.

  1. Browse to Program Files\Microsoft Office\Office folder (Office12 for a 2007 installation).
  2. Locate a program called ‘selfcert.exe’. If it is not present you’ll need to rerun office setup and add [b]Digital Signature for VBA Projects[/b] from the [b]Office Tools[/b] section.
  3. Execute selfcert.exe.
  4. Type your name into the field provided. This will generate a self-signed certificate for you, you can look it up in Control Panel→Internet→Content→Certificates.
  5. Next, open Outlook and go to Tools→Macro→Visual Basic Editor.
  6. Go to the Tools menu, and select Digital Signature.
  7. Press the Choose button, select your new certificate from the list and hit okay.
  8. Close Outlook and re-open it. You may be prompted to trust the certificate the first time you use it, but after that you should not see any further security warnings on startup.
Clone this wiki locally