SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using C# programming language and want to define whether Office Web Apps installed on server in order to hide/show MenuItemTemplate

My variant is as follows:

  bool b = File.Exists(@"C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server     Extensions\\14\TEMPLATE\\LAYOUTS\\WordViewer.aspx"); 
  mit.visible=b;      //  mit- means <SharePoint:MenuItemTemplate>

but I need something else... what is the correct method?

share|improve this question

Search through the registry.

Here is one example from Stackoverflow:

share|improve this answer
mit.Visible=GetInstalledApps(); from above mentioned link. Thank you very much Robban1980. – shakizat Aug 15 '12 at 4:30
I changed Method to bool and here code snippet { { using (RegistryKey sk = rk.OpenSubKey(skName)) { string s= (string)sk.GetValue("DisplayName"); if(s=="Microsoft® Office Web Apps") { return true; } }} return false; } – shakizat Aug 15 '12 at 4:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.