I have the following piece of code to open a project file in a SharePoint 2013 event receiver.
ApplicationClass projectApp = new ApplicationClass();
projectApp.FileOpen(filePath, true, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
PjPoolOpen.pjDoNotOpenPool, Missing.Value, Missing.Value, Missing.Value, Missing.Value);This read the file well when the variable file path is assigned with a local path. eg: (@"D:\\test.mpp")
But if I assign a SharePoint document library url where there is an actual document, it removes part of the url and say that file cannot be opened.
Its a COMException and the error is as follows.
{"The file \"//spapp/ProjectDocumentLibrary/test\" cannot be opened."}The actual value of the fileName variable by the time this is executed includes the http part and the .mpp extension.
Any thoughts on overcoming this?