title: How to make C++ app switch between different MS office versions?
body: <p>I have an old MFC tool to convert xls files to txt.
  It is designed for some certain data structure and it's not easy to rewrite it with new framework (e.g. Qt).</p>
  
  <p>The app works with excel and there is file 'Office.h', where office versions macro is defined:</p>
  
  <pre><code>// Office.h
  
  //#define Uses_MSO97
  //#define Uses_MSO2000
  //#define Uses_MSO2002
  //#define Uses_MSO2003
  //#define Uses_MSO2007
  #define Uses_MSO2010
  </code></pre>
  
  <p>The question is: how to make the app to define which MSO version is present at the computer and use it?</p>
  
  <p>I'd say, I have an access to source code.
  The macro is used as:</p>
  
  <pre><code>#ifdef Uses_MSO2007
  #import "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE12\mso.dll" \
      rename("DocumentProperties", "DocumentPropertiesXL") \
      rename("RGB", "RBGXL")
  #import "c:\Program Files (x86)\Common Files\microsoft shared\VBA\VBA6\vbe6ext.olb"
  #import "C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE" \
      rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL") \
      rename("DocumentProperties", "DocumentPropertiesXL") \
      rename("ReplaceText", "ReplaceTextXL") \
      rename("CopyFile", "CopyFileXL") no_dual_interfaces
  #endif
  </code></pre>