Establecer estilo de WordArt predefinido en el texto de la forma con C++
Contents
[
Hide
]
Escenarios de uso posibles
Puede establecer un estilo de WordArt predefinido en el texto de la forma usando Aspose.Cells. Por favor, utilice FontSetting.SetWordArtStyle() o FontSettingCollection.SetWordArtStyle() para este propósito.
Establecer estilo de WordArt predefinido en el texto de la forma
El siguiente código de ejemplo crea un cuadro de texto con algún texto y luego establece el estilo de WordArt predefinido de su texto usando el método FontSetting.SetWordArtStyle(). Así es como se ve el archivo de Excel de salida en Microsoft Excel.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
using namespace Aspose::Cells::Drawing;
int main()
{
Aspose::Cells::Startup();
// Create workbook object
Workbook workbook;
// Access first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// Create a textbox with some text
TextBox textbox = worksheet.GetShapes().AddTextBox(0, 0, 0, 0, 100, 700);
textbox.SetText(u"Aspose File Format APIs");
textbox.GetFont().SetSize(44);
// Sets preset WordArt style to the text of the shape.
FontSetting fntSetting = textbox.GetRichFormattings()[0];
fntSetting.SetWordArtStyle(PresetWordArtStyle::WordArtStyle3);
// Save the workbook in xlsx format
workbook.Save(u"..\\Data\\02_OutputDirectory\\outputSetPresetWordArtStyle.xlsx");
std::cout << "Workbook saved successfully with preset WordArt style!" << std::endl;
Aspose::Cells::Cleanup();
}