none
Error : PowerPoint could not open the file. RRS feed

  • Question

  • using Powerpoint = Microsoft.Office.Interop.PowerPoint;
    using Microsoft.Office.Core;
     
     
    try
    {
     Powerpoint.Application App = new Powerpoint.Application();
     Powerpoint.Presentation Pr = App.Presentations.Open(Server.MapPath("~/Amit.pptx"));
     Powerpoint.Presentation Pr2 = App.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoTrue);
     List<Powerpoint.Presentation> Prlist = new List<Powerpoint.Presentation>();
     Prlist.Add(Pr);
     Prlist.Add(Pr2);
     Pr.Slides[3].Copy();
     Pr2.Slides.Paste();
     Pr.Slides[5].Copy();
     Pr2.Slides.Paste();
     Pr2.SaveAs(AppDomain.CurrentDomain.BaseDirectory.ToString() +  DateTime.Now.ToString().Replace("/", "").Replace(":", "").Replace(" ", ""));
     Pr.Close();
     Pr2.Close();
     App.Quit();
     }
     catch (Exception ex)
     {
      Response.Write(ex.Message.ToString());
     }
     finally
     {
     }

    Above Code is to collect slide from 1st ppt file & put into new PPT file...

     

    WE GIVE ACCESS PERMISSION to POWERPOINT SLIDE.DLL FROM Control Panel\All Control Panel Items\Administrative Tools\Component Services

       
    Powerpoint.Presentation Pr = App.Presentations.Open(Server.MapPath("~/Amit.pptx"));
     
    Following Error we get form above code:

    Error :

    PowerPoint could not open the file.

    Error post on Azure Development forum Link:http://social.technet.microsoft.com/Forums/en-IN/windowsazuredevelopment/thread/22d925cd-b0ba-4b94-885f-738ea1aa07bc

     

    Above code is use on Azure Web Role so plz help me on basis of Windows Azure

    Plz help me......

     
     
    Thnks & Regard's
     
    Chetan


    Thursday, September 29, 2011 9:24 AM

Answers

  • Hello,

    I'd start the PowerPoint UI and try to open the file, the path and name of which is returned by Server.MapPath("~/Amit.pptx").


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    Thursday, September 29, 2011 9:58 AM

All replies