Free Support Forum - aspose.com

The type or namespace name 'Shape' could not be found (are you missing a using directive or an assembly reference?)

Hi,

I am working on ASP.net 1.1

I am using Aspose Version: 5.1.0.0

I am getting the error

The type or namespace name 'Shape' could not be found (are you missing a using directive or an assembly reference?)

at line
(shapes[0] as Shape).ImageData.SetImage(HttpContext.Current.Server.MapPath("") + "\\Images\\assets\\logo_nucleus.gif");

Below is my code

Please guide

Many Thanks,

Code snippet:

using Aspose.Words;

Aspose Version: 5.1.0.0


Document doc = OpenDoc(strTemplate); doc.MailMerge.ExecuteWithRegions(dataSet);
HeaderFooter myHeader = doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary];
NodeCollection shapes = myHeader.GetChildNodes(NodeType.Shape, true);


// Error at below line
(shapes[0] as Shape).ImageData.SetImage(HttpContext.Current.Server.MapPath("") + "\\Images\\assets\\logo_nucleus.gif");
doc.Save(HttpContext.Current.Server.MapPath("") + "\\pdf\\Supplier\\TestDoc.doc");

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Please try adding Aspose.Words.Drawing namespace or using Aspose.Words.Drawing.Shape.

Hope this helps.

Best regards.