title: Send keypress to error messages on opening Word document
body: <p>I am having some problems on sending key strokes to an error message while opening a document.</p>
  
  <p>The document I am trying to open in a Word for Dos 5.5 document that is missing the style sheet, you can manually click ignore and the file opens, but I have 1000+ more file to do this with so i want to automate this.</p>
  
  <p>I am opening this document up in either Office XP, 2003 or 2010 but i cant get the keystrokes to affect the messages.</p>
  
  <p>The code I have been attempting is as follows:</p>
  
  <pre><code>Dim objWord As New Word.Application
      Dim objDoc As New Word.Document
  
      objDoc = objWord.Documents.Open(TempDir + ("\\" + fileInf.Name))
  
      System.Threading.Thread.Sleep(5000)
      SendKeys.Send("{Enter}")
      System.Threading.Thread.Sleep(5000)
      SendKeys.Send("{&amp;I}")
      System.Threading.Thread.Sleep(5000)
  
      objWord.WindowState = Word.WdWindowState.wdWindowStateNormal
      objWord.Visible = True
  </code></pre>
  
  <p>I have used the visible = true just to see what i going on, but the messages just sit there.</p>