none
Advanced Search is not working properly for non-default store RRS feed

  • Question

  • Hi,

    I am using AdvancedSearch() method and the results are successfully saved if the search was run on default store. When I set another store as a default and (after restarting Outlook) try to call Save on results an error occurs: "System.Runtime.InteropServices.COMException (0x80040107): The operation failed. An object could not be found.". I can see that actually results are returned correctly. Do you have any ideas?

    My VSTO project runs for Outlook 2007 and 2010.

    I posted the same question in a VSTO forum thread, which seems to be dead already.

    Thanks,
    Tigran

    Friday, February 3, 2012 8:59 PM

All replies

  • Hi Tigran,

     

    Thanks for posting in the MSDN Forum.

     

    I never think that AdvancedSearch has relationship with default store. I would recommend you provide some snippet to explain your scenario.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Monday, February 6, 2012 5:52 AM
    Moderator
  • Hi Tom,

    Thanks for the reply.

    The code bellow is a short version, but I have tried and it has the same problem.

    ...
    Application.AdvancedSearch("'\\Personal Folders'",
    	"(\"urn:schemas-microsoft-com:office:office#Keywords\" = 'Cat_1')",
    	true, "Tabbles categories");
    ...
    
    ...
    private void Application_AdvancedSearchComplete(Search search)
    {
    	if (search.Results.Count != 0)
    	{
    		search.Save("My Results");
    	}
    }
    ...
    
    When the data file of "Personal Folder" is set as default one the code works. But after change the default the error occurs on Save().

    Here is another thread: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/73405554-1478-4953-88e7-add758e989ec. There it is suggested that the target folder name might be specified wrongly, but it shouldn't be the case here as the results aren't empty. Only the Save fails.

    Thanks,
    Tigran

    Monday, February 6, 2012 6:10 PM
  • Hi,

    I have tried to delete the .pst files and try the same with new files. Unfortunately the results are the same.

    Could you help please?

    Thanks,
    Tigran

    Friday, February 10, 2012 9:28 PM