Posted on: 3/28/2011 2:06:38 AM | Views : 255

Hi,
   i have to open macro enabled word (.docm) file in firefox. so for this i am setting
the Response.ContentType by calling GetMimeType below funtion, but it does not
open file with extension .docm. code is working fine in IE.
what should i do to open file in give formate?
 private string GetMimeType(string fileName) {
      //string mimeType = "application/unknown";
      string mimeType = "application/vnd.msword.document.12";
      string ext = System.IO.Path.GetExtension(fileName).ToLower();
      Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
      if(regKey != null && regKey.GetValue("Content Type") != null)
        mimeType = regKey.GetValue("Content Type").ToString();

...

Go to the complete details ...