形状がスマートアート形状かどうかの判定
Contents
[
Hide
]
可能な使用シナリオ
スマートアートシェイプは、Microsoft Excelの特別な形状であり、自動的に複雑な図を作成できます。Shape.IsSmartArtプロパティを使用して、形状がスマートアートシェイプか通常の形状かを特定できます。
シェイプがスマートアートシェイプかどうかを判定する
以下のサンプルコードは、第一のShapeのShape.IsSmartArtプロパティの値が出力されるsample Excel fileをロードし、出力するコンソールの出力結果を表示しています。
サンプルコード
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 smart art shape - Excel file | |
Workbook wb = new Workbook("sampleSmartArtShape.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Access first shape | |
Shape sh = ws.Shapes[0]; | |
//Determine if shape is smart art | |
Console.WriteLine("Is Smart Art Shape: " + sh.IsSmartArt); |
コンソール出力
Is Smart Art Shape: True