How to Determine the Version of Microsoft Word using VBScript/JScript?


office How to Determine the Version of Microsoft Word using VBScript/JScript? jscript Microsoft Office vbscript windows scripting host

Microsoft Word

The quickest way to determine the version of Microsoft Word installed on the current PC is to run the following VBScript.

1
2
3
4
5
6
Dim objWord
Set objWord = CreateObject("Word.Application")
WScript.Echo "Version: " & objWord.Version
WScript.Echo "Build: " & objWord.Build
WScript.Echo "Product Code: " &  objWord.ProductCode()
objWord.Quit
Dim objWord
Set objWord = CreateObject("Word.Application")
WScript.Echo "Version: " & objWord.Version
WScript.Echo "Build: " & objWord.Build
WScript.Echo "Product Code: " &  objWord.ProductCode()
objWord.Quit

The VBScript creates the COM object Word.Application if Word is installed of course. It will then invoke the properties to retrieve the version information, which will output something like this:

Version: 16.0
Build: 16.0.9226
Product Code: {90160000-000F-0000-0000-0000000FF1CE}

You could also use the Microsoft JScript that runs on Windows Scripting Environment to achieve the same task:

1
2
3
4
5
var objWord = new ActiveXObject("Word.Application");
WScript.Echo ("Version: " + objWord.Version);
WScript.Echo ("Build: " _ objWord.Build);
WScript.Echo ("Product Code: " +  objWord.ProductCode());
objWord.Quit();
var objWord = new ActiveXObject("Word.Application");
WScript.Echo ("Version: " + objWord.Version);
WScript.Echo ("Build: " _ objWord.Build);
WScript.Echo ("Product Code: " +  objWord.ProductCode());
objWord.Quit();

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
222 words
Last Post: SteemVBS Development - GetVotingPower, Get Post URL from Comment, Suggested Password, Effective SP, VestsToSP and more!
Next Post: The ChromeBookmark Cryptocurrency Lookup Tool in Javascript

The Permanent URL is: How to Determine the Version of Microsoft Word using VBScript/JScript?

Leave a Reply