JavaScript determines the version of Office __java

Source: Internet
Author: User

Using JavaScript to determine the Office version is useful in project development, by being an online Office editor in OA system, where we need to have Office Online editing tools that support multiple versions of Office, such as Office2003, 2007. Office writes the key value in the registry when it is installed, in Hkey_current_user/software/microsoft/office.

We can see the version of Office by opening the Registry, and the Office version corresponds to the registry key values as follows:

11.0 office2003;

12.0 office2007;

14.0 office2010;

Here's the code listing:

     var version= ""; function Readofficeversion () {var word=null; try {word=new ActiveXObject ("W Ord.application "); }catch (e) {alert (1), check that your machine has Microsoft Office 2003/2007;/n2 installed, and that you check that your browser settings enable ActiveX controls. "); } if (word. version=== "11.0") {version= "office2003";} else if (word. version=== "12.0") {version= "office2007";} else if (word. version=== "14.0") {version= "office2010";}//close Word process in a timely manner. Application.Quit (); return version; }  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.