I am trying to automate process of generating Equations in Microsoft Word 2010 using VBA and inserting those into Excel since it doesnt support oMath object. Problem lies in oMath.BuildUp method. It doesnt interpret stuff like \sqrt, \times, \delta in the same way that it is interpreted when entered by hand.
For example entering code Celsius = \sqrt(x+y) + sin(5/9 \times (Fahrenheit – 23 (\delta)^2)) into Equation will give this result http://i43.tinypic.com/10xc7zp.jpg which is fine.
But when using macro VBA or recording macro this Method is not working as it should be and it gives result like this: http://i42.tinypic.com/29c5geg.png. Stuff like \sqrt, \times, \delta is ignored. Why? Here is macro that I used to generate second picture.
I feel this might be a bug
For example entering code Celsius = \sqrt(x+y) + sin(5/9 \times (Fahrenheit – 23 (\delta)^2)) into Equation will give this result http://i43.tinypic.com/10xc7zp.jpg which is fine.
But when using macro VBA or recording macro this Method is not working as it should be and it gives result like this: http://i42.tinypic.com/29c5geg.png. Stuff like \sqrt, \times, \delta is ignored. Why? Here is macro that I used to generate second picture.
Code:
Sub genEQ()
Dim objRange As Range
Dim objEq As OMath
Set objRange = Selection.Range
objRange.Text = "Celsius = \sqrt(x+y) + sin(5/9 \times (Fahrenheit – 23 (\delta)^2))"
Set objRange = Selection.OMaths.Add(objRange)
Set objEq = objRange.OMaths(1)
objEq.BuildUp
End Sub
I feel this might be a bug