Bestimmen, ob es sich um eine SmartArt Form handelt
Mögliche Verwendungsszenarien
SmartArt-Formen sind spezielle Formen in Microsoft Excel, mit denen Sie automatisch komplexe Diagramme erstellen können. Mit der Eigenschaft Shape.IsSmartArt können Sie feststellen, ob die Form eine SmartArt-Form oder eine normale Form ist.
Feststellen, ob eine Form ein SmartArt-Form ist
Der folgende Beispielcode lädt die Beispiel-Excel-Datei mit einer SmartArt-Form, wie in diesem Screenshot gezeigt. Dann wird der Wert der Eigenschaft Shape.IsSmartArt der ersten Form ausgegeben. Bitte beachten Sie die Konsolenausgabe des untenstehenden Beispielcodes.
Beispielcode
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
//Load the sample smart art shape - Excel file | |
Workbook wb = new Workbook("sampleSmartArtShape.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape | |
Shape sh = ws.getShapes().get(0); | |
//Determine if shape is smart art | |
System.out.println("Is Smart Art Shape: " + sh.isSmartArt()); |
Konsolenausgabe
Is Smart Art Shape: true