عيّن نمط WordArt المعين مسبقًا على نص الشكل
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
يمكنك تعيين نمط WordArt المعين مسبقًا على نص الشكل باستخدام Aspose.Cells. الرجاء استخدامFontSetting.SetWordArtStyle ()أوFontSettingCollection.SetWordArtStyle ()طرق لهذا الغرض.
عيّن نمط WordArt المعين مسبقًا على نص الشكل
يقوم نموذج التعليمات البرمجية التالي بإنشاء مربع نص به بعض النص ثم يقوم بتعيين نمط WordArt المعين مسبقًا للنص الخاص به باستخدامFontSetting.SetWordArtStyle () طريقة. هذه هي الطريقة التي يستخدمها ملفملف اكسل الناتجيبحث في Microsoft Excel.
This file contains 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"); |