title: Opening a Word document with .doc extension with Eclipse SWT OleClientSite in Java
body: <p>I'm working on a program that uses the Eclipse SWT OleClientSite (in Windows 7) to open a Word document inside an RCP application. For the past two years, this program has called the following constructor:</p>
  
  <pre><code>OleClientSite clientSite = new OleClientSite(oleFrame, SWT.NULL, new File(documentFileName));
  </code></pre>
  
  <p>Since the latest update to SWT, this constructor now throws an exception when attempting to open Word documents with a ".doc" extension. Word documents with a ".docx" extension are still functioning correctly. The problem seems to be that OleClientSite isn't properly recognizing ".doc" as a Word extension, since explicitly inputting this information with the following constructor works:</p>
  
  <pre><code>OleClientSite clientSite = new OleClientSite(oleFrame, SWT.NULL, "Word.Document", new File(documentFileName));
  </code></pre>
  
  <p>This constructor comes with a warning, however, stating that it is never to be used: </p>
  
  <blockquote>
    <p>IMPORTANT:This method is not part of the public
            API for OleClientSite. It is marked public only so that it
            can be shared within the packages provided by SWT. It is not
            available on all platforms, and should never be called from
            application code.</p>
  </blockquote>
  
  <p>Oddly enough, even though this constructor explicitly says it should never be used, it is <a href="http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet262.java" rel="nofollow">used on the Eclipse SWT Snippets Website as an example of how to open a .doc file</a>...</p>
  
  <p>If anyone has any pointers, I'd greatly appreciate it. So far my options seem to be either to forbid my users from using ".doc" files or to roll back to an old version of SWT.</p>