الوصول إلى تسمية العرض الخاصة بكائن Ole المرتبط وتعديلها
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
Microsoft يسمح لك Excel بتغيير تسمية العرض الخاصة بكائن Ole كما هو موضح في لقطة الشاشة التالية. يمكنك أيضًا الوصول إلى تسمية العرض الخاصة بكائن Ole أو تعديلها باستخدام واجهات برمجة التطبيقات Aspose.Cells بامتدادOleObject.Labelخاصية.
الوصول إلى تسمية العرض الخاصة بكائن Ole المرتبط وتعديلها
يرجى الاطلاع على نموذج التعليمات البرمجية التالي ، حيث يقوم بتحميل ملفنموذج لملف Excelالذي يحتوي على كائن Ole. يصل الرمز إلى كائن Ole ويغير تسميته من نموذج APIs إلى Aspose APIs. يرجى الاطلاع على إخراج وحدة التحكم الموضح أدناه والذي يوضح تأثير نموذج التعليمات البرمجية على نموذج ملف 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 | |
//Load the sample Excel file | |
Workbook wb = new Workbook("sampleAccessAndModifyLabelOfOleObject.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Access first Ole Object | |
Aspose.Cells.Drawing.OleObject oleObject = ws.OleObjects[0]; | |
//Display the Label of the Ole Object | |
Console.WriteLine("Ole Object Label - Before: " + oleObject.Label); | |
//Modify the Label of the Ole Object | |
oleObject.Label = "Aspose APIs"; | |
//Save workbook to memory stream | |
MemoryStream ms = new MemoryStream(); | |
wb.Save(ms, SaveFormat.Xlsx); | |
//Set the workbook reference to null | |
wb = null; | |
//Load workbook from memory stream | |
wb = new Workbook(ms); | |
//Access first worksheet | |
ws = wb.Worksheets[0]; | |
//Access first Ole Object | |
oleObject = ws.OleObjects[0]; | |
//Display the Label of the Ole Object that has been modified earlier | |
Console.WriteLine("Ole Object Label - After: " + oleObject.Label); |
إخراج وحدة التحكم
Ole Object Label - Before: Sample APIs
Ole Object Label - After: Aspose APIs