Create Fractions with VBA

In response to a question on the Programming Forum I developed a VBA macro to create a numeric fraction.  It can, like MicroStation, create any fraction, using any font: it is not restricted to the glyphs available in MicroStation's RSC font libraries.  Here's 3/16 rendered using the Tahoma font...


The code works by creating a cell or text node and adjusting the origin and size of each text element within that cell or node.  I took that approach because the more elegant method — TextNode.AppendStackedFraction() — offered by .NET and C++ is not available in VBA.

The code illustrates how to compose a stacked fraction, and how to edit the text components of a TextNodeElement.