Définir le style WordArt prédéfini sur le texte de la forme
Contents
[
Hide
]
Scénarios d’utilisation possibles
Vous pouvez définir un style WordArt prédéfini pour le texte de la forme à l’aide de Aspose.Cells. Veuillez utiliserFontSetting.SetWordArtStyle()ou alorsFontSettingCollection.SetWordArtStyle()méthodes à cet effet.
Définir le style WordArt prédéfini sur le texte de la forme
L’exemple de code suivant crée une zone de texte avec du texte, puis définit le style WordArt prédéfini de son texte à l’aide deFontSetting.SetWordArtStyle() méthode. C’est ainsi que lefichier excel de sortieregarde dans 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"); |