Reputation: 488
In am using MS Word via OLE to produce documents from my application. I want to give the users that have MS Office 2007 SP2 installed the ability to save the documents as PDF. This is only available in SP2, and the option should be hidden if the service pack is not installed (and of course also for users of previous versions of MS Office).
Is this information available anywhere, like in the registry or any configuration file?
Upvotes: 6
Views: 8043
Reputation: 5345
Programatically check whether version of the MSO.DLL file is greater than or equal to :
"12.0.6425.1000"
This is the value for the file if SP2 and above is installed.
Upvotes: 0
Reputation: 4518
Ok, this is a bit late but you can determine the Service pack directly from VBA without having to mess with the registry. Obviously you'd need to update it as Microsoft updates Office.
Using the support pages for the different versions off Office you can get the build number and use a function to determine the service pack etc. Office 2007 shows slight discrepancies between the different applications within office so you'd have to tweak as required.
Then a function as follows will do the job for Excel Office 2007+:
Function DetermineExcelServicePack() As String
Dim sReturn As String
If Application.Version = "12.0" Then
If Application.Build < 6214 Then
sReturn = "Excel 2007, RTM"
ElseIf Application.Build < 6425 Then
sReturn = "Excel 2007, SP1"
ElseIf Application.Build < 6611 Then
sReturn = "Excel 2007, SP2"
Else
sReturn = "Excel 2007, SP3"
End If
ElseIf Application.Version = "14.0" Then
If Application.Build < 6029 Then
sReturn = "Excel 2010, RTM"
ElseIf Application.Build < 7015 Then
sReturn = "Excel 2010, SP1"
Else
sReturn = "Excel 2010, SP2"
End If
ElseIf Application.Version = "15.0" Then
sReturn = "Excel 2013, RTM"
Else
sReturn = "This version (" & Application.Version & "-" & Application.Build & ") is not supported by this function"
End If
DetermineExcelServicePack = sReturn
End Function
Upvotes: 1
Reputation: 11
The update is installed in the following registry key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109030000000000000000F01FEC\Patches\6D6C63B08D5FFAE4FB4934672A03DAB5
Upvotes: 1
Reputation: 1807
For the actual version infos that apply to the individual service packs have a look at this well hidden kb entry:
http://support.microsoft.com/kb/928116
Upvotes: 2
Reputation: 11
There are different plugins from Microsoft to provide the print to PDF feature:
and SP2 installs these Addins too.
I was looking for a way to test if the PDF feature is installed or not. The following file is only present if the PDF feature is installed (by an add-in or by the SP) on a machine:
C:\Program Files\Common Files\Microsoft Shares\Office12\EXP_PDF.DLL
Upvotes: 1
Reputation: 23016
Couldn't find anything helpful for you but here is something which you might find useful.
Office version is stored in registry
HKEY_LOCAL_MACHINE \Software\Microsoft\Office\12.0\Common\productVersion
the value 12.0 changes for office 2003 and 2007. This key has a number. I think checking this number for different version (with/without SP1/SP2) and see if there sia difference.
Upvotes: 4