title: how to check outlook is configured for current user
body: <p>I want to check if outlook is installed on given machine and configured for current user. I am using below code...</p>
  
  <pre><code> private static bool IsOutlookProfileConfigured2()
          {
              try
              {
                  RegistryKey currentUser = Registry.CurrentUser;
                  RegistryKey regWMSprofile = currentUser.OpenSubKey
                  (@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
                  if (regWMSprofile == null)
                  {
                      regWMSprofile = currentUser.OpenSubKey
                  (@"Software\Microsoft\Office\15.0\Outlook\Profiles");
                      if (regWMSprofile == null)
                      {
                          return false;
                      }
                      Console.WriteLine(@"Found on path==&gt;Software\Microsoft\Office\15.0\Outlook\Profiles");
                  }
                  else
                  {
                      Console.WriteLine(@"Found on path==&gt;SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles");
                  }
  
                  Outlook.Application OlApplication = new Outlook.Application();
  
                  if (regWMSprofile.SubKeyCount &gt; 0)
                  {
                      if (OlApplication == null)
                      {
                          return false;
                      }
                      Outlook.NameSpace olNameSpace =
                      OlApplication.GetNamespace("MAPI");
  
                      if (olNameSpace != null &amp;&amp; olNameSpace.Accounts !=
                      null &amp;&amp; olNameSpace.Accounts.Count &gt; 0)
                      {
                          return true;
                      }
                  }
                  else
                  {
                      return false;
                  }
  
              }
              catch (Exception ex)
              {
                  return false;
              }
  
              return false;
          }
  </code></pre>
  
  <p>method is saying outlook profile is found at "Software\Microsoft\Office\15.0\Outlook\Profiles".</p>
  
  <p>Outlook 2013 is installed on users machine but not configured.</p>
  
  <p>so this method opens outlook profile configuration wizard.</p>
  
  <p>Can anyone help me with fixing this function or some sample code that will check if outlook is configured for current user and should not start profile configuration wizard.</p>
  
  <p>Thanks in advance.</p>