title: MODI OCR error When Using Microsoft Office 2013 in C#
body: <p>I Planned to use OCR in my project and searched more OCR methods and i didnt find anything correctly. And at last i heard about MODI and i tried that . But It throwing Following error:</p>
  
  <blockquote>
    <p>Retrieving the COM class factory for component with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B} failed due to the following error: 80040154</p>
  </blockquote>
  
  <p>I'm Using <code>Microsoft Office 2013</code> and <code>visual studio 2012</code>.</p>
  
  <p>The code me using is follows:</p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
      {
          CheckFileType(@"E:\\");
      }
  
      public void CheckFileType(string directoryPath) 
      { 
          IEnumerator files = Directory.GetFiles(directoryPath).GetEnumerator(); 
          while (files.MoveNext()) 
          { 
          //get file extension 
          string fileExtension = Path.GetExtension(Convert.ToString(files.Current));
  
          //get file name without extenstion 
          string fileName=Convert.ToString(files.Current).Replace(fileExtension,string.Empty);
  
          //Check for JPG File Format 
          if (fileExtension == ".jpg" || fileExtension == ".JPG") // or // ImageFormat.Jpeg.ToString()
          { 
          try 
          { 
          //OCR Operations ... 
          MODI.Document md = new MODI.Document(); 
          md.Create(Convert.ToString(files.Current)); 
          md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true); 
          MODI.Image image = (MODI.Image)md.Images[0];
          //create text file with the same Image file name 
          FileStream createFile = new FileStream(fileName + ".txt",FileMode.CreateNew);
  
          //save the image text in the text file 
          StreamWriter writeFile = new StreamWriter(createFile); 
          writeFile.Write(image.Layout.Text); 
          writeFile.Close(); 
          } 
          catch (Exception) 
          { 
          MessageBox.Show("This Image hasn't a text or has a problem", 
          "OCR Notifications", 
          MessageBoxButtons.OK, MessageBoxIcon.Information); 
          } 
          } 
          } 
      } 
  </code></pre>
  
  <p>Can anyone help me in this ? Is that problem based on Microsoft Office version or Do i Need to make any changes ?  Is that any better OCR dll ? 
  thanks ..</p>