Reputation: 352
I'm working VSTO and I have an issue. I want to get a Version of Office but I can't
I want to get 2008
Please help me! Thanks
I'm using C#
Upvotes: 1
Views: 428
Reputation: 49395
You can get the file version information of the Office application.
// Retrieve the path e.g. from the InstallRoot Registry key
var fileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE");
var version = new Version(fileVersionInfo.FileVersion);
// or you can get the information from the running instance using the `Process` class
var process = Process.GetProcessesByName("winword").First();
string fileVersionInfo = process.MainModule.FileVersionInfo.FileVersion;
var version = Version(fileVersionInfo);
Upvotes: 1