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:
OleClientSite clientSite = new OleClientSite(oleFrame, SWT.NULL, new File(documentFileName));
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:
OleClientSite clientSite = new OleClientSite(oleFrame, SWT.NULL, "Word.Document", new File(documentFileName));
This constructor comes with a warning, however, stating that it is never to be used:
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.
Oddly enough, even though this constructor explicitly says it should never be used, it is used on the Eclipse SWT Snippets Website as an example of how to open a .doc file...
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.