using PickFolder from within property page

Add-in Express™ Support Service
That's what is more important than anything else

using PickFolder from within property page
Application not responding. 
Patrick Jox




Posts: 83
Joined: 2009-05-09
Hello,
I try to use the olNamespace.PickFolder() method to configure my application. This is done as follows.


      private void SelectOutlookFolder()
      {
         Outlook._Application olApp = null;
         Outlook._NameSpace olNs = null;
         Outlook.MAPIFolder olFolder = null;

         try
         {
            olApp = ((AddinModule)AddinModule.CurrentInstance).OutlookApp as Outlook._Application;
            olNs = olApp.GetNamespace("MAPI") as Outlook._NameSpace;

            olFolder = olNs.PickFolder() as Outlook.MAPIFolder;

            if (olFolder == null)
               return;

            this.appDef = new kapaya.SalesAssistant.BusinessLayer.Configuration.ApplicationDefinition();
            this.appDef.FolderId = olFolder.EntryID;
            this.appDef.StoreId = olFolder.StoreID;
            this.appDef.FolderName = olFolder.Name;
         }
         catch (System.Exception ex)
         {
            throw ex;
         }
         finally
         {
            if (olFolder != null)
               Marshal.ReleaseComObject(olFolder);
         }

      }



The problem is, that my application is not responding after having executed the PickFolder method.

I am working with

    Outlook 2007
    Windows 7
    Visual Studio 2008


Any suggestions on this issue?

Kind regards
Patrick
Posted 17 Jan, 2010 08:25:07 Top
Patrick Jox




Posts: 83
Joined: 2009-05-09
Same as with FolderBrowserDialog.

The problem was, that the buttons through which I opened the forms have been on TabControl / TabPage.

After placing the button directly in the property page everything works.

Kind regards
Patrick
Posted 18 Jan, 2010 12:52:44 Top