If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Differentiate between Task and Task Request in NewInspector event
Hi All,
I am handling NewInspector event to show my custom form when user clicks on "New Task" or "New Task Request". But somehow I am getting same message class (i.e. IPM.Task) for both commands. Can anyone of you pls. suggest a way to determine that whether NewInspector request is for "Task" or "Task Request"? Thanks. |
Ads |
#2
|
|||
|
|||
Differentiate between Task and Task Request in NewInspector event
There's no way to tell the difference directly. TaskRequestItems cannot be
created by a user, they are created by Outlook when the request is received in the recipient's Inbox. Your best bet is to trap the Click event for the respective CommandBarButtons for the Task entries in the New dropdown. Try this code in your ThisOutlookSession module to see how to do it: Option Explicit Private WithEvents myTaskButton As Office.CommandBarButton Private WithEvents myTaskRequestButton As Office.CommandBarButton Private WithEvents objInspectors As Outlook.Inspectors Enum TaskTypes RegularTask = 0 TaskRequest = 1 End Enum Private lngCurrentTaskType As TaskTypes Private Sub Application_Startup() Dim objCBs As CommandBars Dim objCBCs As CommandBarControls Set objInspectors = Application.Inspectors Set objCBs = Application.ActiveExplorer.CommandBars Set myTaskRequestButton = objCBs.FindControl(, 2006) 'TaskRequestItem Set myTaskButton = objCBs.FindControl(, 1100) 'TaskItem End Sub Private Sub myTaskButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean) 'Set global variable to track which button was clicked to be read by the NewInspector event lngCurrentTaskType = RegularTask End Sub Private Sub myTaskRequestButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean) 'Set global variable to track which button was clicked to be read by the NewInspector event lngCurrentTaskType = TaskRequest End Sub Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector) MsgBox "Task Type = " & lngCurrentTaskType End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Piyush Gupta" wrote: Hi All, I am handling NewInspector event to show my custom form when user clicks on "New Task" or "New Task Request". But somehow I am getting same message class (i.e. IPM.Task) for both commands. Can anyone of you pls. suggest a way to determine that whether NewInspector request is for "Task" or "Task Request"? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom TASK REQUEST form error | Cass | Outlook - General Queries | 1 | October 4th 06 07:28 PM |
custom TASK REQUEST form error | Cass | Outlook - General Queries | 0 | October 3rd 06 03:51 PM |
OFT as a Task Request | SteveM - GSTC | Outlook - Using Forms | 9 | September 5th 06 09:57 AM |
Can not open "task request" "task accepted" in Inbox | LaParker | Outlook - General Queries | 2 | August 9th 06 10:09 PM |
Task read receipt request | edro61 | Outlook - Using Forms | 0 | June 13th 06 06:21 PM |