i have created an app that uploads files to a folder and then takes the files from that folder and convert it to images.
here is the code
if (FileUpload1.HasFile)
{
string file = System.IO.Path.GetFullPath(FileUpload1.PostedFile.FileName);
string filname = FileUpload1.PostedFile.FileName;
//UPLOADS THE FILE INTO THE FOLDER
FileUpload1.PostedFile.SaveAs(Server.MapPath("~\\NewFolder1\\") + FileUpload1.FileName);
//TAKES THE PATH and file
string strPath = Server.MapPath(Request.ApplicationPath) + "~/NewFolder1/" + filname;
//assign the file to ppt
ApplicationClass pptApplication = new ApplicationClass();
Presentation pptPresentation = pptApplication.Presentations.Open(strPath, MsoTriState.msoFalse,
MsoTriState.msoFalse, MsoTriState.msoFalse);
var slides = new List
targetPath = Server.MapPath("~/NewFolder1/");
targetPath += "\\{0}";
for (var i = 1; i <= pptPresentation.Slides.Count; i++)
{
.
.
but when i run the app it gives the follwoing error.
System.Runtime.InteropServices.COMException: PowerPoint could not open the file.
Presentation pptPresentation = pptApplication.Presentations.Open(strPath, MsoTriState.msoFalse....
please tell me where is the problem and what i need to correct
Suthish NairPosted Oct 28, 2011, 3:18 PM
Javeed M ShaikhPosted Oct 28, 2011, 3:04 PM
Look like a permission issue here, maybe your code has no right to open/ file.
Check if the folder has "NETWORK SERVICE" account for read/write permissions.