VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "+"
   ClientHeight    =   2496
   ClientLeft      =   48
   ClientTop       =   336
   ClientWidth     =   3744
   LinkTopic       =   "Form1"
   ScaleHeight     =   2496
   ScaleWidth      =   3744
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Create Object"
      Height          =   492
      Left            =   480
      TabIndex        =   0
      Top             =   240
      Width           =   2652
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents ol As Outlook.Application
Attribute ol.VB_VarHelpID = -1
Option Explicit

Private Sub Command1_Click()
'this should be run only if outlook is running. If you can run this code when
'outlook is launched you should be able to accomplish your task.

Set ol = GetObject(, "Outlook.Application.9")
End Sub

Private Sub ol_ItemSend(ByVal Item As Object, Cancel As Boolean)
MsgBox "A message is being sent with the subject" & Item.Subject
End Sub

Private Sub ol_NewMail()
MsgBox "You have new mail"
End Sub

Private Sub ol_Quit()
MsgBox "Outlook is quitting"
Set ol = Nothing
End Sub

Private Sub ol_Startup()
MsgBox "Outlook is starting up"
End Sub

