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.
- Copy the array initialization code to the subroutine Shapes_Init.
- Remove a top rectangle in the array if you don't need it.
- If you did so, renumber the indices for shape array.
- 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:
- Isosceles Triangle
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.