Class OMaths (Word VBA)
A collection of equations. Use the OMath object to access individual members of the collection. To use a OMaths class variable it first needs to be instantiated, for example
Dim oms as OMaths
Set oms = ActiveDocument.Range.OMaths
Add
Creates an equation, from the text equation contained within the specified range, and returns a Range object that contains the new equation.
Add (Range)
Range: Specifies a range that contains a text equation.
Dim objRange As Range
Dim objEq As OMath
Set objRange = Selection.Range
objRange.Text = "Celsius = (5/9)(Fahrenheit ? 32)"
Set objRange = Selection.OMaths.Add(objRange)
Set objEq = objRange.OMaths(1)
objEq.BuildUp
BuildUp
Converts all equations in the collection to professional format.
To change equations to linear format, use the Linearize method.
ActiveDocument.Range.OMaths.BuildUp
Count
Returns the number of items in the OMaths collection.
Dim lngCount As Long
lngCount = ActiveDocument.Range.OMaths.Count
Item
Returns an OMath object that represents the specified item in the collection.
Item (Index)
Index: Specifies the ordinal position of the object within the collection.
Dim omh As OMath
Set omh = ActiveDocument.Range.OMaths(Index:=1)
Linearize
Converts all equations in the collection to linear format.
To change equations to professional format, use the BuildUp method.
ActiveDocument.Range.OMaths.Linearize