test for existence of MS Office

Xancholy

Well-known member
Joined
Aug 29, 2006
Messages
143
Programming Experience
Beginner
How can I test for existence of MS Office 2003 and up on end users machine on my app startup ?

Thanks !
 
Before adding references, I need to check MS Office version numbers. Some of these references were added post Office 2000
VB.NET:
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop.Word

How can WMI help me find the Office version numbers?
 
You have to install the correct version PIA (Primary Interop Assemblies) along with your app, the app interacts through these assemblies. Then you have put a label on the box saying that your app requires this version Office to operate.
 
Thanks. I learned this new today.

What happens if I reference say, Microsoft.Office.Interop.Word and it is not available (Office 2000 does not have it). Major code failure.

http://www.microsoft.com/downloads/details.aspx?FamilyId=3C9A983A-AC14-4125-8BA0-D36D67E0F4AD&displaylang=en

Will installing the Office PIA as prerequisite allow Office 2000 users to 'access' the Microsoft.Office.Core
and Microsoft.Office.Interop.Word references ? NO. Interesting reading here

Office 2003/7 must be already installed on end users system in order for the relevant PIA to be installed. Argh

So my question remains : how can I test for MS Office >2003 and if not available, messagebox.show "not available" ?
 
Last edited:
Do some automation code in a Try-Catch and see if it throws, example this thread.
 
Back
Top