TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saifullah khan
NA
335
300.3k
could not open the file.
Oct 28 2011 12:54 PM
hi
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<string>();
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
Reply
Answers (
2
)
How to develop a website using .NET Programmability Support?
Issue Log