Auto-Start Timer when Opening Existing Journal Item?

  • Thread starter Thread starter michael
  • Start date Start date
M

michael

Hi folks -

I've been looking for a way to automatically start the "timer" feature
on an existing journal item every time it is opened, so that the
"duration" field in list view collects the aggregate total of how many
minutes that journal item has been open since it was created.

I have found lots of info on how to auto-start the timer when a NEW
journal item is created, but setting starttimer on OPEN still escapes
me.

If anyone can help out I'd appreciate it!

michael
 
Here's the VBA code to do start the timer on every journal item. Paste into
the built-in ThisOutlookSession module and make sure macro security is not
set to High unless you've signed the project:

Dim WithEvents colInspectors As Outlook.Inspectors
Dim WithEvents objInspector As Outlook.Inspector

Private Sub Application_Startup()
Set colInspectors = Application.Inspectors
End Sub

Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
Set objInspector = Inspector
End Sub

Private Sub objInspector_Activate()
Dim objItem As Object
Set objItem = objInspector.CurrentItem
If objItem.Class = olJournal Then ' a JournalItem
If objItem.Size <> 0 Then
objItem.StartTimer
End If
End If
Set objItem = Nothing
Set objInspector = Nothing
End Sub
 
Back
Top