Hi,
We are working on a Project VSTO Add-in using Visual Studio 2013 and targeting .net framework 4.5.2. In our application, we have to check if the current view is an active view.
We are using the below code to determine that.
string curViewName = app.ActiveProject.CurrentView;
Boolean viewOk = false;
foreach (string viewName in app.ActiveProject.TaskViewList) {
if (viewName == curViewName) {
viewOk = true;
break;
}
}
return viewOK.
This was working on on our development machine with MS Project 2013 installed.
But, when the same code is being executed in a machine with only MS Project 2007 installed, it is failing even though the current view is Gantt Chart.
We tried debugging it further and found that the below API's returning filters instead of views.
1) ActiveProject.TaskViewList
2) ActiveProject.ResourceViewList
The same code was working when the application was in Visual Studio 2010 and targeted to .net framework 4.0.
Please let us know if it is a bug?
If yes, is there any fix/workaround available?
If no, do we need to set any properties for Microsoft.office.* references to make this work?
Currently, the Embedded Interops = false, specific version = false, version=15.0.0.0 (MSProject, Office)
Thanks,
Murali