Aspose.Slides.Examples.CSharp.Shapes.FindShapeInSlide.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Shapes();

            // Create directory if it is not already present.
            bool IsExists = System.IO.Directory.Exists(dataDir);
            if (!IsExists)
                System.IO.Directory.CreateDirectory(dataDir);

            // Instantiate a Presentation class that represents the presentation file
            using (Presentation p = new Presentation(dataDir + "FindingShapeInSlide.pptx"))
            {

                ISlide slide = p.Slides[0];
                // Alternative text of the shape to be found
                IShape shape = FindShape(slide, "Shape1");
                if (shape != null)
                {
                    Console.WriteLine("Shape Name: " + shape.Name);
                }
            }
        }
        
FindShapeInSlide