NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would NetOffice Resolve the Issue of Different Versions of Office Installed?

kennydarnold opened this issue · comments

I develop a commercially sold PowerPoint VSTO add-in that reads data from open Microsoft Project files. It takes what the user has currently selected in MS Project and creates a PowerPoint chart of it. The PowerPoint Add-in references the Microsoft.Office.Interop.MSProject library to connect with MS Project.

I have a user who has MS Office 365 installed for the "normal" office suite (Excel, PowerPoint, Word, Outlook) but uses MS Project 2013. Because of this, the PowerPoint add-in is not able to read data from the user's Active MS Project file.

The Add-in works fine when the versions of MS Project and the rest of Office are the same, but seems to lose it's interoperability when the installed version of MS Project is lower than the installed version of PowerPoint.

Would using NetOfficeFw.MSProject resolve this issue? looking for something other than telling the user "You need to upgrade MS Project to be on the same version as the rest of Office"

Hi @kennydarnold, yes, you can use NetOffice to target multiple versions of MS Office.

As NetOffice is calling the APIs dynamically and does not rely on extact version of interop libraries this scenario should work.

@jozefizso thank you for the response. I will be giving it a go. One thing, to get the active instance of MS Project I've been using the Microsoft.VisualBasic.Interaction.GetObject() method. What is the NetOffice equivalent of this to get the currently running instance of MS Project? I can ask this question in StackOverflow if you prefer.

Thanks for your help!

A good start are sample projects, for example here is one to automate the Word: https://github.com/NetOfficeFw/NetOffice/tree/main/Examples/Word/C%23/Standard%20Examples

Using the MS Project's Application object should be enough.

PS: you must use the v1.8.1 packages as those are the last one to support the MS Project.