Change SmartArt Shape via VBA
-
2010年10月22日 22:52
I have a process where I'm attempting to convert basic SmartArt based shapes from a 3D rectangular shape with rounded corners to a flat, outline only, square corner rectangle.
My current code is able to do everything but change the shape to the square corner shape that is in Autoshapes.
The key lines I have working within a loop are:
ActiveDocument.InlineShapes(I).SmartArt.QuickStyle = Application.SmartArtQuickStyles.Item(1)
ActiveDocument.InlineShapes(I).SmartArt.Color = Application.SmartArtColors.Item(1)
However, I don't see a way to change the shape used by the SmartArt. I can change the shape of the rectangle via the UI. I tried recording a macro, but no luck. Any pointers are welcome.
Thanks!
Treb
すべての返信
-
2010年10月24日 11:29モデレータ
Hi Treb
I've spent hours trying to make this work and never was successful. Theoretically:
Selection.InlineShapes(1).SmartArt.Nodes(1).Shapes.AutoShapeType = msoShape12pointStar
it should be possible using AutoShapeType of the Shape or Shapes object. But I get an "Object does not support this action" error. So it appears Word isn't allowing this change via the object model...
Cindy Meister, VSTO/Word MVP- 回答の候補に設定 Amy LiModerator 2010年11月1日 2:08
- 回答としてマーク Amy LiModerator 2010年11月9日 9:33

