RE: Event of Changing the Task Status

Status
Not open for further replies.
Q

Qk11bms

This works when the task is opened in a window (Inspector).

How is it possible to get an event when the task status is changed with

"in-cell edits" enabled? There you don't have the inspector opened.

Thanks!

"Alan Moseley" wrote:


> Put the following code into your ThisOutlookSession code window. It will
> work when the task is opened and then completed:-

> Dim WithEvents myInspectors As Inspectors
> Dim WithEvents myTaskItem As TaskItem
> Private Sub Application_Startup()
> Set myInspectors = Outlook.Inspectors
> End Sub
> Private Sub myInspectors_NewInspector(ByVal Inspector As Inspector)
> If TypeName(Inspector.CurrentItem) = "TaskItem" Then
> Set myTaskItem = Inspector.CurrentItem
> End If
> End Sub
> Private Sub myTaskItem_Close(Cancel As Boolean)
> Set myTaskItem = Nothing
> End Sub
> Private Sub myTaskItem_PropertyChange(ByVal Name As String)
> If Name = "Status" Then
> If myTaskItem.Complete = True Then
> MsgBox "Task " & myTaskItem.Subject & " now completed"
> End If
> End If
> End Sub

> Obviously replace the messagebox with your required code.
> > Alan Moseley IT Consultancy
> http://www.amitc.co.uk

> If I have solved your problem, please click Yes below. Thanks.

> "Mark" wrote:
>
> > I would like to be able to execute some code when the user changes the status
> > of a task from "Not Started" to "Complete"
> > Any help would be appreciated
> > Mark
 
Q

QWxhbiBNb3NlbGV5

Try the following within your ThisOutlookSession code window:-

Dim WithEvents myTasks As Items

Private Sub Application_Startup()

Set myTasks =

Outlook.GetNamespace("MAPI").GetDefaultFolder.olFolderTasks.Items

End Sub

Private Sub myTasks_ItemChange(ByVal Item As Object)

If Item.Complete = True Then

MsgBox "Task Complete"

End If

End Sub

Alan Moseley IT Consultancy

http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.

"BMunk" wrote:


> This works when the task is opened in a window (Inspector).
> How is it possible to get an event when the task status is changed with
> "in-cell edits" enabled? There you don't have the inspector opened.

> Thanks!

> "Alan Moseley" wrote:
>
> > Put the following code into your ThisOutlookSession code window. It will
> > work when the task is opened and then completed:-
> > Dim WithEvents myInspectors As Inspectors
> > Dim WithEvents myTaskItem As TaskItem
> > Private Sub Application_Startup()
> > Set myInspectors = Outlook.Inspectors
> > End Sub
> > Private Sub myInspectors_NewInspector(ByVal Inspector As Inspector)
> > If TypeName(Inspector.CurrentItem) = "TaskItem" Then
> > Set myTaskItem = Inspector.CurrentItem
> > End If
> > End Sub
> > Private Sub myTaskItem_Close(Cancel As Boolean)
> > Set myTaskItem = Nothing
> > End Sub
> > Private Sub myTaskItem_PropertyChange(ByVal Name As String)
> > If Name = "Status" Then
> > If myTaskItem.Complete = True Then
> > MsgBox "Task " & myTaskItem.Subject & " now completed"
> > End If
> > End If
> > End Sub
> > Obviously replace the messagebox with your required code.
> > > > Alan Moseley IT Consultancy
> > http://www.amitc.co.uk
> > If I have solved your problem, please click Yes below. Thanks.
> > "Mark" wrote:
> >
> > > I would like to be able to execute some code when the user changes the status
> > > of a task from "Not Started" to "Complete"
> > > Any help would be appreciated
> > > > Mark
 
Q

Qk11bms

THANKS!

"Alan Moseley" wrote:


> Try the following within your ThisOutlookSession code window:-

> Dim WithEvents myTasks As Items
> Private Sub Application_Startup()
> Set myTasks =
> Outlook.GetNamespace("MAPI").GetDefaultFolder.olFolderTasks.Items
> End Sub
> Private Sub myTasks_ItemChange(ByVal Item As Object)
> If Item.Complete = True Then
> MsgBox "Task Complete"
> End If
> End Sub

> > Alan Moseley IT Consultancy
> http://www.amitc.co.uk

> If I have solved your problem, please click Yes below. Thanks.

> "BMunk" wrote:
>
> > This works when the task is opened in a window (Inspector).
> > How is it possible to get an event when the task status is changed with
> > "in-cell edits" enabled? There you don't have the inspector opened.
> > Thanks!
> > "Alan Moseley" wrote:
> >
> > > Put the following code into your ThisOutlookSession code window. It will
> > > work when the task is opened and then completed:-
> > > > Dim WithEvents myInspectors As Inspectors
> > > Dim WithEvents myTaskItem As TaskItem
> > > Private Sub Application_Startup()
> > > Set myInspectors = Outlook.Inspectors
> > > End Sub
> > > Private Sub myInspectors_NewInspector(ByVal Inspector As Inspector)
> > > If TypeName(Inspector.CurrentItem) = "TaskItem" Then
> > > Set myTaskItem = Inspector.CurrentItem
> > > End If
> > > End Sub
> > > Private Sub myTaskItem_Close(Cancel As Boolean)
> > > Set myTaskItem = Nothing
> > > End Sub
> > > Private Sub myTaskItem_PropertyChange(ByVal Name As String)
> > > If Name = "Status" Then
> > > If myTaskItem.Complete = True Then
> > > MsgBox "Task " & myTaskItem.Subject & " now completed"
> > > End If
> > > End If
> > > End Sub
> > > > Obviously replace the messagebox with your required code.
> > > > > > Alan Moseley IT Consultancy
> > > http://www.amitc.co.uk
> > > > If I have solved your problem, please click Yes below. Thanks.
> > > > > "Mark" wrote:
> > > > > I would like to be able to execute some code when the user changes the status
> > > > of a task from "Not Started" to "Complete"
> > > > Any help would be appreciated
> > > > > > Mark
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
H Changing Organizer of event (for single to total calendar move; long way ) Exchange Server Administration 4
J Outlook 2010 Outlook/Win7 Client logging Event ID 36887 Using Outlook 0
K Recurring all day annual event Using Outlook 3
P Restore an individual all-day recurring event Using Outlook 2
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
K Working with Explorer.Close event Outlook VBA and Custom Forms 3
F Outlook 2016 call to Stop Timer Event Outlook VBA and Custom Forms 4
D Event ID issues Exchange Server Administration 2
J ItemChange event Outlook VBA and Custom Forms 11
T Outlook 2016 Calendar multiday event display Using Outlook 4
oliv- Treat once an email with the ItemAdd event in a shared mailbox Outlook VBA and Custom Forms 2
M Automatically create event in calendar when task is created Outlook VBA and Custom Forms 1
A UID field in iCal files - unique per-event or per-user or both? Using Outlook 2
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
B on flag message event - create task Outlook VBA and Custom Forms 22
Diane Poremsky Change the All Day Event Default Free/Busy to "Busy" New Slipstick.com Articles 3
C Calendar - Centering an event in Outlook? Using Outlook 1
J Outlook calendar...How to add an event or appointment without a border around it? Using Outlook 9
J Create Calendar Alert Event form Mail Subject line? Using Outlook 4
S Item Add Event fires intermittently Outlook VBA and Custom Forms 3
R Why is a meeting organizer me and not the creator of the event? Using Outlook 1
V Calendar event acting odd Using Outlook 7
G Capture "forward event" ? Outlook VBA and Custom Forms 11
P Change the Outlook.com "from" address for calendar event invites Using Outlook 9
20 Ton Squirrel Detect Application_Startup event completion Outlook VBA and Custom Forms 1
L Outlook 2007 All Day Event Using Outlook 27
I Event listener for deleted items Using Outlook 6
M Save Attachments Event? Using Outlook 0
Commodore Calendar Folder property is missing - Event 27 Using Outlook 11
G Quit event code - 2007 Using Outlook 3
J Capturing forward event when multiple items are selected Using Outlook 0
P Trying to get 'Calendar Name' to appear like 'Subject' and 'Location' in event Calendar Printing Assistant 0
G What event happens when you open 2 copies of your inbox? Using Outlook 5
D Adding a participant automatically to a calendar event Using Outlook 1
N Combobox in outlook add ons toolbar not firing event on main window resized Using Outlook 3
D Extracting Location info from All Day Event in mailboxes into webpage Exchange Server Administration 3
H Conflicts with other event in calendar ( outlook 2007 & 2010) Using Outlook 0
B Restoring Deleted Recurring Event AND Notes Using Outlook 8
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
S Outlook Recurring event Using Outlook 1
D Task and Event View in Outlook 2010? Using Outlook 3
I Event ID 2937 after update to Exchange 2010 SP1 ArbitrationMailbox Exchange Server Administration 4
S Error starting MS Outlook - Problem Event Name CLR20R3 Using Outlook 2
I Event ID 14031 logged after transition to Exchange 2010 Exchange Server Administration 4
J Recurring event (from 2006 and deleted multiple times) continues to send me multiple reminders Using Outlook 1
I Event ID 2937 after update to Exchange 2010 SP1 Exchange Server Administration 8
0 trying to get rid of the "end" time of each event within each day on the calendar. This shows up wh Using Outlook 1
Y MSExchange AuditLogsearch Event ID:4002 Exchange Server Administration 0
A "Item could not be found" error when attempting to send Outlook 2007 calendar event update Using Outlook 2
M Event 8010, MSExchangeTransport Exchange Server Administration 2
Similar threads


















































Top