A question from one of our ISVs regarding their IBF business case was the following: Can we from within the IBF Information Window detect whether the user is using Word, Excel or Outlook?

Detecting whether you are running in Word or Excel is easy. It was more difficult to check on the Outlook host. The problem is that the email that is IBF-enabled is actually a Word document. Good thing is that there is a property you can check on the ActiveDocument. This property is the Kind property and to my guess, it is useful to solve my problem. Maybe I am not seeing another more elegant solution. If so, correct me!

Here is the code you will have to insert into the user control you are making available in an IBF region:

  public IRegionFrameProxy HostProxy
  {
   set
   {
    // retrieve reference to the IMediator type
    IRegionFrameProxy fp = (IRegionFrameProxy)value;
    IMediator mediator = fp.Host.Mediator;

    // get the Word Application Object   
    System.Type ias = typeof(IApplicationService);    
    IApplicationService iasApp = (IApplicationService)mediator.GetService(ias);
    
    // check whether you are running in Word/Excel/Outlook
    if(iasApp.Application is Word.Application)
    {     
     Word.Application wdApp = (Word.Application)iasApp.Application;     
     if(wdApp.ActiveDocument.Kind == Microsoft.Office.Interop.Word.WdDocumentKind.wdDocumentEmail)
      MessageBox.Show("You are running IBF in Outlook");
     else
      MessageBox.Show("You are running IBF in Word");
    }
    else
    {
     if(iasApp.Application is Excel.Application)
      MessageBox.Show("You are running IBF in Excel");
    }
   }
  }

Another question that was raised was the ability to communicate with the email itself (grab data out of the email). LOL! Keep you up-to-date on that work!