none
Deleting a solution module RRS feed

  • Question

  • Hi,

    I can create solution module from below code:

    solutionsModule = _explorer.NavigationPane.Modules.GetNavigationModule(Outlook.OlNavigationModuleType.olModuleSolutions) as Outlook.SolutionsModule;

    solutionsModule.AddSolution(solutionRoot, Outlook.OlSolutionScope.olHideInDefaultModules);

    Here my custom folder "solutionRoot" gets converted into a solution module.

    Now after deleting my "solutionRoot" folder, the solution module does not gets deleted by default. How can I delete my existing solution module?

    Monday, April 28, 2014 10:10 AM

Answers

  • Hello Haris,

    You need to set the Visible property of the SolutionsModule class to false. Thus, your solutions module will be hidden in the Navigation pane. You can remove the root folder of the solutions module when Outlook starts next time.

    Monday, April 28, 2014 10:28 AM
  • Solutions module folders are not preserved between sessions. You can delete the root folder when the corresponding solutions mule is unloaded, i.e. at next startup as I wrote in previous message.
    Monday, April 28, 2014 2:04 PM
  • Haris,

    In that particular scenario user is responsible for deleting solutions folders. Note, you can delete folders in the custom actions of your add-in installer when you uninstall it. There is no other way.

    Thursday, May 1, 2014 11:54 AM

All replies

  • Hello Haris,

    You need to set the Visible property of the SolutionsModule class to false. Thus, your solutions module will be hidden in the Navigation pane. You can remove the root folder of the solutions module when Outlook starts next time.

    Monday, April 28, 2014 10:28 AM
  • I have just notice that the root folder of solutionmodule does not gets deleted in any case. That is why when i unload addin on current outlook instance and then load it again then it appends another root to existing module. The existing root folder get pass by the following check which is quite weird.

    rootStoreFolder = this.Application.Session.DefaultStore.GetRootFolder() as Outlook.Folder;

                    // if solution root folder exists
                    if (rootStoreFolder.Folders.Cast<Outlook.Folder>().Where(c => c.Name == SOLUTION_MODULE_NAME).Any())
                    {
                        solutionRoot = rootStoreFolder.Folders[SOLUTION_MODULE_NAME] as Outlook.Folder;
                    }
                    else
                    {
                        solutionRoot = rootStoreFolder.Folders.Add(SOLUTION_MODULE_NAME, Outlook.OlDefaultFolders.olFolderInbox) as Outlook.Folder;  
                    }

    The root folder is only deletable when i close my outlook and delete it on addin startup event.

    Monday, April 28, 2014 1:58 PM
  • Solutions module folders are not preserved between sessions. You can delete the root folder when the corresponding solutions mule is unloaded, i.e. at next startup as I wrote in previous message.
    Monday, April 28, 2014 2:04 PM
  • Actually I have a specific scenario when user disable my addin which contains solution module. On starting next session of outlook my addin startup event would not call. So I have no place available to delete my solution module  folder from outlook.
    Wednesday, April 30, 2014 10:36 AM
  • Haris,

    In that particular scenario user is responsible for deleting solutions folders. Note, you can delete folders in the custom actions of your add-in installer when you uninstall it. There is no other way.

    Thursday, May 1, 2014 11:54 AM