Unable to pass COM object of type 'System .__ ComObject' to interface type 'Microsoft.Office.Interop.PowerPoint.Presentation'

I am using the current MSWord 2003 and create a Powerpoint object and then apply the template. on these lines I am throwing an exception.

"Unable to pass COM object of type 'System .__ ComObject' to interface enter 'Microsoft.Office.Interop.PowerPoint.Presentation" This operation failed because a call to QueryInterface on the COM component for the interface with IID' {9149349D-5A91- 11CF-8700-00AA0060263B} 'failed due to the following error: This interface is not supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

    ((Microsoft.Office.Interop.PowerPoint.Presentation)objPresentation).Tags.Add("Carma DocSys~XML", m_Model.Document.get_Data.OuterXml);
    objMaster = ((Microsoft.Office.Interop.PowerPoint.Presentation)objPresentation).TitleMaster;

      

code

        object objApplication; //As Object ' PowerPoint.Application
        object objPresentation = new object();  // As Object ' PowerPoint.Presentation
        string strTemplate;//     As String

        objApplication = new Microsoft.Office.Interop.PowerPoint.Application();
       strTemplate = Convert.ToString(ndModel.GetAttribute("template"));
       objPresentation ((Microsoft.Office.Interop.PowerPoint.Application)objApplication).Presentations.Add();
      ((Microsoft.Office.Interop.PowerPoint.Presentation)objPresentation).ApplyTemplate(strTemplate);

      ((Microsoft.Office.Interop.PowerPoint.Presentation)objPresentation).Tags.Add("Carma DocSys~XML", m_Model.Document.get_Data.OuterXml);

   objMaster = ((Microsoft.Office.Interop.PowerPoint.Presentation)objPresentation).TitleMaster;

      

+3


source to share





All Articles