none
"The Operation Failed" error on Task and Appointment Close Method RRS feed

  • Question

  • We have an Outlook VSTO add-in that is used by about 50 users.  It syncs tasks and appointments between our application and Outlook.  It works great for all by one user.  For one user, it throws a "The Operation Failed" error on the Close(Save) method for all of the tasks and all of the appointments.  Another user at the site is able to use his account and Outlook profile successfully with the add-in on the same computer.  We are able sync this user's information with our own Outlook profiles and it works, so there seems to be an issue with the user's Outlook profile/.pst file.

    Basic code:

    Outlook.TaskItem t = null; 
    t=Application.CreateItem(Outlook.OlItemType.olTaskItem);
    
    /*...sets Status, Date, Subject, Body, Work, Category, Importance, User properties...*/
    
    try{
        ((Outlook._TaskItem)t).Close(Outlook.OlInspectorClose.olSave); 
    
    } catch (Exception ex) 
    {      
        //ex.Message="The Operation Failed."
    }
    
    /*... goes to clean up code ...*/

    My first thought was that maybe she had reached some max size on her profile, but she can create and save a Task in Outlook directly so the saving seems to only be an issue within the add-in.

    When I looked for this "The operation failed." error I found all sorts of support on it for hundreds of different reasons.  I was able to verify that there are no special characters at play and also I don't think her profile is corrupted as it does work fine outside of the add-in.  I also had them reinstall the add-in and restart the computer.  I am lost on what else I should try to resolve the issue. 


    Cindy

    Monday, October 28, 2013 6:41 PM

All replies

  • If you are not displaying the task, why do you need to call Close instead of just calling TaskItem.Save?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, October 29, 2013 2:14 PM
  • Dmitry,

    I am not sure why I was using Close.  Most likely it was from an example I found at the very beginning and since it worked, I never went back to change it.  Anyway,  I switched it over to call Save and the user is still experiencing the same error on both tasks and appointment items.  Any other ideas?  It does not give me any other error details except "The operation failed."

    Thanks!


    Cindy

    Friday, November 1, 2013 3:28 PM
  • Can the item be manually created in that PST file?

    Is PST grow policy enabled on that machine?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, November 8, 2013 2:00 PM
  • Dmitry,

    I provided the client with a stripped down add-in that eliminates our application from the picture.  The add-in just creates 10 tasks (Task 1, Task 2, etc) in the default store and logs information to a file.  The user received the same error on Save of each task: The operation failed.  

    When you asked if the item can be manually created in the PST file, I am not clear on what you mean.  She is able to create a task in Outlook if she goes to New Items->Task.  It just won't create tasks from an Outlook add-in. 

    I will inquire with them about the PST grow policy.  Would she be able to create a task in Outlook at all if that was enabled?

    Is there any sort of security issues that could be occurring between the add-in and Outlook?  The add-ins do work for a different user on the same Outlook installation but I believe the working user is an administrator and the broken user is a regular user.

    Thanks!


    Cindy

    Friday, November 22, 2013 8:33 PM
  • They informed me that they are not using PST files and both users are administrators.

    Cindy

    Monday, November 25, 2013 9:22 PM
  • The client informed me now that they are able to use the add-in when the user is not in a Group Policy.  Once the user is added to the Group Policy, the add-in will no longer save the Tasks and throws the aforementioned error.    It seems like it is in a read-only mode because it does allow them to configure the add-in and the add-in is also able to write to a text log file.  It just can't create any tasks or appointments.

    I am not familiar with Exchange and Group Policies, but is there a setting or some list they need to add the add-in to for it to be able to manipulate items in Outlook?


    Cindy

    Wednesday, February 12, 2014 4:00 PM