Imposta lo stile predefinito di WordArt al testo della forma
Possibili Scenari di Utilizzo
È possibile impostare uno stile WordArt predefinito per il testo della forma utilizzando Aspose.Cells. Si prega di utilizzare i metodi FontSetting.SetWordArtStyle() o FontSettingCollection.SetWordArtStyle() per questo scopo.
Imposta lo stile predefinito di WordArt al testo della forma
Il seguente codice di esempio crea una casella di testo con del testo e imposta lo stile WordArt predefinito del testo utilizzando il metodo FontSetting.SetWordArtStyle(). Ecco come appare il file excel di output in Microsoft Excel.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Create workbook object | |
Workbook workbook = new Workbook(); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Create a textbox with some text | |
TextBox textbox = worksheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 700); | |
textbox.Text = "Aspose File Format APIs"; | |
textbox.Font.Size = 44; | |
// Sets preset WordArt style to the text of the shape. | |
FontSetting fntSetting = textbox.GetRichFormattings()[0] as FontSetting; | |
fntSetting.SetWordArtStyle(PresetWordArtStyle.WordArtStyle3); | |
// Save the workbook in xlsx format | |
workbook.Save(outputDir + "outputSetPresetWordArtStyle.xlsx"); |