programmatically identify office 2016 vs 2019 vs 365 version in c#

Copper Contributor

anyone know how to programmatically identify whether an app is interacting with office 2016 or 2019 or 365?
as "2016 and 2019 have the same version numbers and release dates" according to docs.microsoft, which makes simply using getFileVersionInfo unproductive.
I checked by comparing excel in office 2019 with excel in office 365 and the version numbers were both 16.0 :(

1 Reply

someone [https://github.com/Terminal/DiscordForOffice/issues/7#issuecomment-548454581]
suggested this VB script as a starting point,

[https://gallery.technet.microsoft.com/office/68b80aba-130d-4ad4-aa45-832b1ee49602]

 

maybe one day i'll have a go at re-engineering it...