I'm having trouble finding a consistent version number for several Office products.
This post led me to these KB articles which suggest different ways to find the service packs for Office 2007 and Office 2010 products.
However, the file versions of the Office .exe files are not consistent with the chart.
Using the Excel 2010 installed on my machine as an example:
- Help > About info from Excel: Microsoft Excel 2010 (14.0.6106.5005) SP1
- File version by viewing the properties of Excel.exe: 14.0.6106.5005
- Original file version (from table): 14.0.4756.1000
- SP1 file version (from table): 14.0.6024.1000
Is there a more reliable way to retrieve version numbers and service packs for Microsoft Office products?
We decided to back out of this because it was taking way too much time. However, I thought I'd post what I got in case anyone needs to take it farther.
First, here are the three relevant KB articles which list out the service pack versions:
Method 2 in these articles suggest the properties of the executable file is a reliable way to get the actual file version. Unfortunately, it isn't.
Here's how you can find the executable:
Find the install root for Office:
Then append the name of the executable (with on exception for Office 2003):
With this information, you can get the FileVersionInfo for the selected application. Using Word as an example:
Theoretically, you could now compare this version number to the tables from the KB articles to find the correct service pack. This is where I abandoned my efforts for the reasons listed in the question - you'll find the version numbers just don't match up.
You can use code similar to below to compare the versions for, say Word 2010 SP1:
Here's some code to get the version of Office suite:
If you are trying to get the edition name (i.e. Professional, Ultimate, Student, etc) you are in for an adventure. Here's some untested code fragments that may be useful. It's different for each version of office and each edition so best of luck!
See if you can adapt this code:
What is the best way to get Excel version?
This code uses Application.ProductCode to determine the Office version. ProductCode is a property available in most Office products. I checked Outlook, Word, Excel and Access 2003 and all of them had it.
You may also be able to leverage this code:
Display system and version information
This code takes the MSACCESS.exe filename and uses a Windows API to determine the version and assembly information, from which you would derive the service pack number.