Small Basic Shapes from Microsoft Office

Today, I'd like to introduce about how to convert shapes created by Microsoft Office to Small Basic shapes.  This time I'm using PowerPoint to draw pictures with shapes.  To convert pictures, I wrote PowerPoint macro (VBA).  We can do as well with Excel or Word.

I uploaded the PowerPoint Macro-Enabled Presentation to TechNet Gallery.

You can draw pictures in any slide, and from [VIEW] [Macros] [GetShapes] run the macro.

Then you can get shape array as a textbox in the slide.

This code is just a part of Small Basic program.  Please modify a code generated by Shapes editor as following instructions.

  1. Copy the array initialization code to the subroutine Shapes_Init.
  2. Remove a top rectangle in the array if you don't need it.
  3. If you did so, renumber the indices for shape array.
  4. Change the value of iMax to numbers of elements for shape array.

The code modified like above is here (GJB066).

Supported shapes in this macro (GetShapes Version 0.2) are:

  • Rectangle
  • Isosceles Triangle
  • Oval
  • Text

Line is not supported yet.  Hexagon can be converted to the array but there is no code to show that yet.  I'd like to upgrade this macro and try to write similar one for Excel.

Thanks.