Solved

Powerpoint version and location detection

Posted on 2010-09-07
5
691 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

860 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