Excel Metin Kutusu veya Şeklin Karakter Boşluğunu Değiştirme
Contents
[
Hide
]
Excel metin kutusu veya şeklin karakter boşluğunu FontSetting.TextOptions.Spacing özelliğini kullanarak değiştirebilirsiniz.
Aşağıdaki örnek kod, excel dosyasındaki metin kutusunun karakter boşluğunu 4 noktaya değiştirir ve ardından diske kaydeder.
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 | |
//Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
//Output directory | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
// Load your excel file inside a workbook obect | |
Workbook wb = new Workbook(sourceDir + "sampleChangeTextBoxOrShapeCharacterSpacing.xlsx"); | |
// Access your text box which is also a shape object from shapes collection | |
Shape shape = wb.Worksheets[0].Shapes[0]; | |
// Access the first font setting object via GetCharacters() method | |
FontSetting fs = (FontSetting)shape.GetRichFormattings()[0]; | |
//Set the character spacing to point 4 | |
fs.TextOptions.Spacing = 4; | |
// Save the workbook in xlsx format | |
wb.Save(outputDir + "outputChangeTextBoxOrShapeCharacterSpacing.xlsx", SaveFormat.Xlsx); |