title: Outlook New Mail Window opened from C# seems to have focus but my app still has it
body: <p>I'm having a problem that I've been trying to solve for days now, but without luck!</p>
  
  <p>On my Windows Forms Application I have a grid. One column contains an email address. When the user double clicks this column, I want to open a new E-Mail Window via Outlook automation. This window should have the focus and allow the user to type immediately.</p>
  
  <p>Everything works fine, when:</p>
  
  <ul>
  <li>I'm running my app from Visual Studio.</li>
  <li>Or my app has the focus.</li>
  </ul>
  
  <p>However, when I run my .exe <strong>and</strong> outlook has the focus when I double click the column, the following happens:</p>
  
  <ul>
  <li>The new Mail window opens as expected</li>
  <li>The cursor blinks in the new mail window (as expected)</li>
  <li>when the user starts typing, the cursor still blinks in outlook <strong>but</strong> the typed text appears in the grid of my application, not in outlook.</li>
  </ul>
  
  <p>I was able to reproduce the problem with a simple form that has a textbox on it.</p>
  
  <p>I use the following code:</p>
  
  <pre><code>private void textBox1_MouseDoubleClick(object sender, MouseEventArgs e)
  {
   OpenOutlookMail(textBox1.Text);
  }
  
  private void OpenOutlookMail(string to)
  {
    MailItem item = OutlookApp.CreateItem(OlItemType.olMailItem) as MailItem;
    item.To = to;
    item.Subject = string.Empty;
    item.Body = string.Empty;
  
    item.Display();
  }
  
  protected Application OutlookApp
  {
      get
      {
          if (mOutlookApp == null)
          {
              mOutlookApp = new Application();
  
          }
          return mOutlookApp;
       }
    }
  </code></pre>
  
  <p>What i already tried was to</p>
  
  <ul>
  <li>Activate my current form via this.Activate() before the call to OpenOutlookMail</li>
  <li>Activate the MailItem Inspector Object</li>
  <li>Activate the ActiveWindow and ActiveExplorer of Outlook via Automation</li>
  <li>Using AutoIt as explained here <a href="http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/58b5f15c-a637-4d96-b7b7-05378107eb17" rel="nofollow">Similar Problem with MS Word on the MSDN Forum </a></li>
  </ul>
  
  <p>Any help would be appreciated!</p>