PowerPoint VBA — GetShapes Macro - nonkit/Shapes GitHub Wiki

PowerPoint VBA - GetShapes Macro

Following code is a sample of GetShapes macro for PowerPoint VBA. This macro convert shapes in a PowerPoint slide to shape array for Shapes in Small Basic.

How To Use

  • Create blank presentation with PowerPoint.
  • [VIEW] [Macros], enter GetShapes in [Macro name], [Create] and replace code listed below.
  • Remove shapes and text (except left top rectangle sized 21.1 cm x15.1 cm) if exists.
  • Draw picture with shapes (and textboxes).
  • [VIEW] [Macros] [GetShapes] [Run] for each slide.
  • Copy generated code in subroutine Shapes_init a sample program SJG122.
  • Modify iMax to the number of elements of shape array in SJG122.
  • [Run]

Supported Shapes

  • Rectangle, Oval, Isosceles Triangle, Line, Trapezoid, Hexagon, TextBox

Known Issues

  • Supported only symmetrical shapes (to flip in Small Basic keeping the shapes).
  • Group is not supported. So ungroup before running this macro.
  • Border in trapezoid or hexagon may runs off.
  • Trapezoid and hexagon are not supported Shapes editor yet.

Source Code

See Also

Additional Resources