none
Microsoft.Office.Interop.PowerPoint of 2007 failed to open ppt file but open with 2003 interop RRS feed

  • Question

  • Hi,

    I am using Microsoft.Office.Interop.PowerPoint 2007 to open the PPT file.

    Microsoft.Office.Interop.PowerPoint.Application         m_pptApplication;

     m_pptSourcePresentation = m_pptApplication.Presentations.Open("c:\\abc.ppt",
                                                                           Microsoft.Office.Core.MsoTriState.msoFalse,
                                                                           Microsoft.Office.Core.MsoTriState.msoFalse,
                                                                           Microsoft.Office.Core.MsoTriState.msoFalse);

    But there is one ppt file which is getting error like "Could not open file.".

    NOTE: I tried to open the file in MS-Office 2000 then its open properly but cannot open into the MS-Office 2007.

    Any idea?

    Waiting for reply.

    Thanks in advance.

    Thursday, October 30, 2014 2:45 PM

All replies

  • Hello,

    As the file may need to specify the version of your host application, you may need to refer to the following thread:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/878fcf8c-6372-4e3c-9ae7-6e2bd689e22b/need-to-open-powerpoint-2007-presentation-from-c-windows-forms-application-visualstudio-2008-?forum=officegeneral

    For example, check this application.Presentations.Open2007

    Regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 31, 2014 10:00 AM
  • Hello Shital,

    The system drive requires admin privileges for writing. Try to pass the msoTrue value as the second parameter to open the file as read-only.

    Sunday, November 2, 2014 12:38 PM
  • Hi Shital,

    >>But there is one ppt file which is getting error like "Could not open file.".

    NOTE: I tried to open the file in MS-Office 2000 then its open properly but cannot open into the MS-Office 2007.<<

    I am not able to understand the scenario you are handling exactly. Did you install multiple version of Office on the same computer?

    If I understood correctly, when we automate PowerPoint, the version that is loaded is the version that was last installed.(refer to Office automation when multiple versions of Office are installed

    >>But there is one ppt file which is getting error like "Could not open file.".<<

    Can you share the detail error message with us? Did the suggestion provide by Eugene fix this issue? Did you open already open the presentation?

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 4, 2014 6:20 AM
    Moderator