Imposta lo stile WordArt preimpostato sul testo della forma
Contents
[
Hide
]
Possibili scenari di utilizzo
È possibile impostare lo stile WordArt preimpostato sul testo della forma utilizzando Aspose.Cells. UtilizzareFontSetting.SetWordArtStyle()oFontSettingCollection.SetWordArtStyle()metodi per questo scopo.
Imposta lo stile WordArt preimpostato sul testo della forma
Il seguente codice di esempio crea una casella di testo con del testo e quindi imposta lo stile WordArt preimpostato del relativo testo utilizzandoFontSetting.SetWordArtStyle() metodo. Questo è come ilfile excel di outputcerca in Microsoft Excel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |