views:

120

answers:

2

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?

+2  A: 

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.

Shoban
Thanks! I'll try that!
alfjorgen
There is a difference! Thanks a lot!
alfjorgen
+1  A: 

There are different plugins from Microsoft to provide the print to PDF feature:

  • 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS
  • 2007 Microsoft Office Add-in: Microsoft Save as PDF
  • 2007 Microsoft Office Add-in: Microsoft Save as XPS (does NOT come with PDF support)

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
irgendwienet
on a x64 system you have to look at the "Program Files (x86)" folder. To get it right even on different language versions you can use the following base path (in .net): Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86)
irgendwienet
Interesting find. Thanks!
alfjorgen