ask

Jan 3, 2012 at 1:01 PM

i have some problem with source code.

error statement:

Error    1    'Microsoft.Office.Interop.PowerPoint.Shape' does not contain a definition for 'Chart' and no extension method 'Chart' accepting a first argument of type 'Microsoft.Office.Interop.PowerPoint.Shape' could be found (are you missing a using directive or an assembly reference?)    D:\My Document\kinesis-3387_3\KineSis\KineSis\ContentManagement\Service\Helper\PowerPointDocumentHelper.cs    253    94    KineSis

can give me solution

 

thanks

Coordinator
Jan 3, 2012 at 10:19 PM

I didn't encountered this error so far... make sure you have the right assemblies (under References). What I do have is:

...

Microsoft.Office.Interop.Excel

Microsoft.Office.Interop.PowerPoint

Microsoft.Office.Interop.Word

Office

...

all office related assemblies are version 14.0.0.0 and runtime version v2.0.50727.

If I understand correctly from this error, the problem is at:

...

pp.CurrentOperationTotalElements = EvaluateChart(charts.ElementAt(j).Chart);

...

private int EvaluateChart(Microsoft.Office.Interop.PowerPoint.Chart c)
        {

...

        }

Indeed, 'charts' variable is of type 'Microsoft.Office.Interop.PowerPoint.Shape', but, as the documentation (http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shape_properties.aspx) also says, there is a property called 'Chart', which is the actual shape object.

Long story short, make sure you have office 14 (2010) assemblies included, and not 2007. They are needed only for build, the application will run with 2007 aswell.

Jan 7, 2012 at 2:49 PM

i find solution my problem,this project must use office 2010

 

thanks