Check MS Office license status programmatically

六月ゝ 毕业季﹏ 提交于 2019-12-13 13:24:22

问题


Is it possible to programmatically check MS Office (2007-2016) license status? (C++ preferable)

I'll share with you my research below, maybe it will somehow help.

I know that starting from office 2010 there is OSPP.vbs script to check license status. But since I can't use this script in my code (because of security issues), I'm using WMI to query LicenseStatus from SoftwareLicensingProduct information in C++ .

The problem is that for 2013 office there are 36 licenses returned from the query (2 of them have keys - the first license stands for Word,Excel,PowerPoint, and the second for Visio). For 2016 office there is a license for EACH office application (one for Word, one for Excel, one for Powerpoint and one more for Visio). One of them may expire earlier than another, while for 2013 office there is a common license for Word-Excel-PP and another for Visio. How can I unambiguously detect whether certain license 1) covers the Office application I'm using through object model 2) hasn't expired yet? (Is there some kind of ID for each application which is availble in SoftwareLicensingProduct class?)

N.B. The point is that I'm using Word, Excel, PowerPoint and Visio (2007-2016 versions) through object model in C++ and before starting any of the applications I need to know, whether their licenses have expired.

I'll appreciate any help! Thank you in advance.

来源:https://stackoverflow.com/questions/35436518/check-ms-office-license-status-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!