Detect office version installed - InfoPath Dev
in

InfoPath Dev

Detect office version installed

Last post 11-08-2010 10:35 AM by Potemkine. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-28-2010 05:16 AM

    Detect office version installed

    Hi,

     No idea if this is possible, but is it possible to design an infopath form which detects the version of office installed on the end users machine?

    Thanks,

    Jason.

  • 10-28-2010 07:31 AM In reply to

    Re: Detect office version installed

     If you use Infopath Client, here a some C# code to know the major version of office:

    using Microsoft.Office.Interop;

    string sVersion = string.Empty;
                Microsoft.Office.Interop.Word.Application oApp = new Microsoft.Office.Interop.Word.Application();
                oApp.Visible = false;
                switch (oApp.Version.ToString())
                {
                    case "7.0":
                        sVersion = "95";
                        break;
                    case "8.0":
                        sVersion = "97";
                        break;
                    case "9.0":
                        sVersion = "2000";
                        break;
                    case "10.0":
                        sVersion = "2002";
                        break;
                    case "11.0":
                        sVersion = "2003";
                        break;
                    case "12.0":
                        sVersion = "2007";
                        break;
                    case "14.0":
                        sVersion = "2010";
                        break;
                    default:
                        sVersion = "Too Old!";
                        break;
                }
                MessageBox.Show("Word Build: " + oApp.Version + System.Environment.NewLine + "Word Version: " + sVersion,
                "Office Version", MessageBoxButtons.OK, MessageBoxIcon.Information);
                object a = (object)false;
                object b = (object)1;
                oApp.Quit(ref a, ref b, ref a);
                oApp = null;

  • 11-08-2010 08:44 AM In reply to

    Re: Detect office version installed

     

     Apologies for the response back, but thanks very much for this - really appreciated.

     Can you tell me if this also works in the browser mode? I'm developing forms for SharePoint use, where InfoPath is not installed on the client machine.

    Thanks,

    Jason.

  • 11-08-2010 10:35 AM In reply to

    Re: Detect office version installed

    Hi, no it'snot working on form server because if you run this codes, it will send you the office version of the server and not the client version.

    Sorry

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.