Solved

Powerpoint version and location detection

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Explorer has stopped working 3 24
Clone OS to SSD 5 51
Can't get access/ownership to folder 3 89
Resizing every other graphic 3 14
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

896 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

13 Experts available now in Live!

Get 1:1 Help Now