Word VBA Equations Linear/Professional Display

In this article I will explain how you can use VBA for Word to change the way equations are displayed in a word document. For more information about working with equations please see the link below:


Equation Linear Display:

Equations can be changed to linear display using the Linearize function:

Word Equations Linear
The code below will change the format of all the equations in the document to linear:

Sub Example1()
Dim i As Integer
For i = 1 To OMaths.Count
    OMaths.Item(i).Linearize
Next i
End Sub

Before:

Word, VBA, Equations, Before LInearization
After:

Word, VBA, Equations, after Linearization


Equation Professional Display:

Equations can be changed to professional display using the BuildUp function:

Word Equations, Professional

The code below will change the format of all the equations in the document to professional:

Sub Example2()
Dim i As Integer
For i = 1 To OMaths.Count
    OMaths.Item(i).BuildUp
Next i
End Sub

Before:

Word, VBA, Equations, after Linearization
After:

Word, VBA, Equations, Before LInearization
You can download the file and code for this article from the link below:

See also:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website  www.software-solutions-online.com

Leave a Reply

Your email address will not be published. Required fields are marked *