Solved

Powerpoint version and location detection

Posted on 2010-09-07
5
687 Views
Last Modified: 2012-05-10
How do  you programmatically find the version and location of powerpoint on a win 7 system.
0
Comment
Question by:itrphil
  • 3
5 Comments
 
LVL 2

Expert Comment

by:coronoahcoro
ID: 33624064
what programming language are you using? VBA?
0
 

Author Comment

by:itrphil
ID: 33624084
IT's C#

Thanks
0
 
LVL 3

Accepted Solution

by:
Chocco earned 500 total points
ID: 33624520
You could try the following Code;

You can use the following code:

private bool IsOutlookInstalled()
{
Type requestType = Type.GetTypeFromProgID("Powerpoint.Application", false);
if (requestType == null)
{
RegistryKey key = null;
try
{
key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Office", false);
if (key != null)
{
double version = 0.0, temp = 0.0;
string[] valueNames = key.GetSubKeyNames();
for(int i=0; i<valueNames.Length; i++)
{
temp = 0.0;
try
{
temp = Convert.ToDouble(valueNames[i],
CultureInfo.CreateSpecificCulture("en-US").NumberFormat);
}
catch
{
}
if (temp > version) version = temp;
}
key.Close();
if (version != 0.0)
requestType = Type.GetTypeFromProgID("Powerpoint.Application."+version.ToString().Replace(",", "."), false);
}
}
catch
{
if (key != null) key.Close();
}
}
return (requestType != null);
}

private int GetOfficeVersion()
{
RegistryKey key = null;
try
{
key = Registry.ClassesRoot.OpenSubKey(Powerpoint.Application\\CurVer", false);
if (key != null)
{
string version = key.GetValue("", "Powerpoint.Application.9").ToString(); key.Close();
int pos = version.LastIndexOf(".");
if (pos >= 0)
{
version = version.Remove(0, pos+1);
return Convert.ToInt32(version);
}
}
}
catch(Exception e)
{
if (key != null) key.Close();
module.DoError(e);
}
return 9;
}
0
 

Author Comment

by:itrphil
ID: 33665438
Does this matter if we have a virtualized version of Office 2010 ?  eg. It seems Office 2010 Home and Student have different Registry entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\PowerPoint\InstallRoot

 than the typical  

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\PowerPoint\InstallRoot

0
 

Author Closing Comment

by:itrphil
ID: 33686091
Need also to know how to find MS 2010 Office Home and Student , Home and Business, and Starter

All these versions uses Microsoft new virtualization App-V CVH.EXE to deliver codes.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most folk recognise that Microsoft Excel, being a numbers-and-formulae-centric application attracts programmers due to the natural fit in mindset. Conversly, when opening Microsoft's dominant presentation creative application, few consider what…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now