Создать, Вставить поля
Contents
[
Hide
]
Вставить поле
Aspose.Diagram for .NET позволяет создавать и вставлятьполе на Microsoft Visio диаграммы из ваших собственных приложений, без автоматизации Microsoft Office.
Образец программирования
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-diagram/Aspose.Diagram-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_InsertField(); | |
// Create a new diagram | |
// Load source Visio diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get Visio page | |
Aspose.Diagram.Page page = diagram.Pages.GetPage("Page-1"); | |
//Get Visio Shape | |
Shape shape = page.Shapes[0]; | |
//Insert field | |
Field fld = new Field(); | |
fld.Value.Val = "1"; | |
shape.Fields.Add(fld); | |
// Save diagram | |
diagram.Save(dataDir + "InsertField_out.vsdx", SaveFileFormat.VSDX); |