ShapeCollection.AddWordArt

ShapeCollection.AddWordArt method

Adds preset WordArt since Excel 2007.s

public Shape AddWordArt(PresetWordArtStyle style, string text, int upperLeftRow, int top, 
    int upperLeftColumn, int left, int height, int width)
ParameterTypeDescription
stylePresetWordArtStyleThe preset WordArt Style.
textStringThe text.
upperLeftRowInt32Upper left row index.
topInt32Represents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnInt32Upper left column index.
leftInt32Represents the horizontal offset of shape from its left column, in unit of pixel.
heightInt32Represents the height of shape, in unit of pixel.
widthInt32Represents the width of shape, in unit of pixel.

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Drawing;

namespace AsposeCellsExamples
{
    public class ShapeCollectionMethodAddWordArtWithPresetWordArtStyleStringInt32IDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Get the shapes collection
            ShapeCollection shapes = worksheet.Shapes;

            // Add a WordArt with specified parameters
            Shape wordArt = shapes.AddWordArt(
                PresetWordArtStyle.WordArtStyle1, 
                "Sample WordArt", 
                10,  // left
                10,  // top
                200, // width
                50,  // height
                100, // rotation
                200  // z-order
            );

            // Save the workbook
            workbook.Save("WordArtDemo.xlsx");
        }
    }
}

See Also