I want to generate math courseware through code. At first, I used Java POI, but it does not support adding animations and mathematical formulas. Later, I learned that there are some methods in VBA, but I am not sure if it can add complex mathematical formulas.
I found a method to input mathematical expressions through searching, like this:
Sub WhatIsTheEquationMadeOf()
Dim x As Long, txtBox As Shape
word = "Solve "
Set txtBox = ActiveWindow.Selection.ShapeRange(1)
If txtBox.Type = msoTextBox Then
With txtBox.TextFrame.TextRange
.Font.Color = RGB(80, 122, 160)
.ParagraphFormat.Alignment = ppAlignCenter
.Font.Size = 22
.Text = word & "2x^2+7x+6=0"
.Characters(Len(word) + 1, .Characters.Count - Len(word)).Select
With Application.CommandBars
.ExecuteMso "InsertBuildingBlocksEquationsGallery"
.ExecuteMso "EquationProfessional"
End With
End With
End If
End Sub
but I don’t know what syntax to use to write other mathematical expressions. For example, a Fraction.
6