GroupDocsGists
10/19/2017 - 11:10 AM

GetShapesInformationExcel.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (CellsDocument doc = Document.Load<CellsDocument>(Utilities.MapSourceFilePath (FilePath)))
{
    foreach (CellsWorksheet worksheet in doc.Worksheets)
    {
        foreach (CellsShape shape in worksheet.Shapes)
        {
            Console.WriteLine(shape.AutoShapeType);
            Console.WriteLine(shape.MsoDrawingType);
            Console.WriteLine(shape.Text);
            if (shape.Image != null)
            {
                Console.WriteLine(shape.Image.Width);
                Console.WriteLine(shape.Image.Height);
                Console.WriteLine(shape.Image.GetBytes().Length);
            }
            Console.WriteLine(shape.Id);
            Console.WriteLine(shape.AlternativeText);
            Console.WriteLine(shape.X);
            Console.WriteLine(shape.Y);
            Console.WriteLine(shape.Width);
            Console.WriteLine(shape.Height);
            Console.WriteLine(shape.RotateAngle);
            Console.WriteLine(shape.IsWordArt);
            Console.WriteLine(shape.Name);
        }
    }
}