none
How to take away the option of accepting/rejecting from a task RRS feed

  • Question

  • Hello,

    I am using the following code to create a task in outlook

     Outlook.Application outApp = new Outlook.Application();
    
                Outlook.TaskItem userTask = outApp.CreateItem(Outlook.OlItemType.olTaskItem);
                userTask.Subject = "Your action responce";
                userTask.DueDate = planned_end_date;
                userTask.StartDate = planned_start_date;
                userTask.ReminderSet = true;            
                userTask.Body = "A " + eventType +" has been assigned to you, with the following information" + Environment.NewLine + description;
                userTask.SchedulePlusPriority = "High";
                userTask.Status = Microsoft.Office.Interop.Outlook.OlTaskStatus.olTaskInProgress;
                userTask.Save();
                userTask.Owner = email; 
                userTask.Assign();            
                userTask.Recipients.Add(email);
                userTask.Recipients.ResolveAll();
                userTask.Send();

    Is there any way to not allow the user to reject this in outlook?

    using VS2010 + office 2007

    thanks,

    ehsan

    Wednesday, April 17, 2013 10:30 AM

Answers

  • You are assigning the task, are you saying that when your code creates the task the user on the computer where the task is created is being prompted to accept or reject the task assignment?
     
    If you want to create the task for the user and the user is on that computer you shouldn't even need to assign it. The task should be created in that user's Outlook and that user will automatically own the task without assigning it to them.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "ehsansad" <=?utf-8?B?ZWhzYW5zYWQ=?=> wrote in message news:0a1e2182-9735-4267-abd8-6eceb9215b65...

    thanks for the your inputs, but that was not exactly what I had in mind. 

    The problem I have is that when the task is created in outlook, I get this question accept or reject the task. Now each time I click on either of them I'll get a message that says you cannot do this because the task does not belong to you?    and since these task are not optional I was thinking of disalowing the user to reject.

    So any idea why I'm getting this error?

    thanks  again

    ehsan


    Ken Slovak MVP - Outlook
    • Marked as answer by ehsansad Thursday, April 18, 2013 9:56 AM
    Wednesday, April 17, 2013 6:12 PM
    Moderator

All replies

  • i do not think so, you would have to create Outlook add-in that hides visual elements that allow for task rejection.
    Wednesday, April 17, 2013 1:37 PM
  • And what if the user never accepts the task and just lets it sit there? An addin that reviews incoming task requests and automatically accepts them might be the best way to manage this.
     
    Of course that assumes that all the employees don't quit as a result of this policy.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:be7fa3e5-6440-49b1-baf8-74ffd26028d3...
    i do not think so, you would have to create Outlook add-in that hides visual elements that allow for task rejection.

    Ken Slovak MVP - Outlook
    Wednesday, April 17, 2013 3:01 PM
    Moderator
  • thanks for the your inputs, but that was not exactly what I had in mind. 

    The problem I have is that when the task is created in outlook, I get this question accept or reject the task. Now each time I click on either of them I'll get a message that says you cannot do this because the task does not belong to you?    and since these task are not optional I was thinking of disalowing the user to reject.

    So any idea why I'm getting this error?

    thanks  again

    ehsan

    Wednesday, April 17, 2013 5:59 PM
  • You are assigning the task, are you saying that when your code creates the task the user on the computer where the task is created is being prompted to accept or reject the task assignment?
     
    If you want to create the task for the user and the user is on that computer you shouldn't even need to assign it. The task should be created in that user's Outlook and that user will automatically own the task without assigning it to them.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "ehsansad" <=?utf-8?B?ZWhzYW5zYWQ=?=> wrote in message news:0a1e2182-9735-4267-abd8-6eceb9215b65...

    thanks for the your inputs, but that was not exactly what I had in mind. 

    The problem I have is that when the task is created in outlook, I get this question accept or reject the task. Now each time I click on either of them I'll get a message that says you cannot do this because the task does not belong to you?    and since these task are not optional I was thinking of disalowing the user to reject.

    So any idea why I'm getting this error?

    thanks  again

    ehsan


    Ken Slovak MVP - Outlook
    • Marked as answer by ehsansad Thursday, April 18, 2013 9:56 AM
    Wednesday, April 17, 2013 6:12 PM
    Moderator