Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Read mpp file inside a document library with C#.NET

$
0
0

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?


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>