DocumentBase.OMaths Property


Gets the collection of T:Microsoft.Office.Interop.Word.OMath objects in the document.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public OMaths OMaths { get; }

Property Value

Type: Microsoft.Office.Interop.Word.OMaths

An OMaths collection that contains the T:Microsoft.Office.Interop.Word.OMath objects in the document.

The following code example iterates through all the T:Microsoft.Office.Interop.Word.OMath objects that exist in the document and sets the justification of each one to be centered. This code requires that you have added at least one T:Microsoft.Office.Interop.Word.OMath object to your document, such as an equation. To use this example, run it from the ThisDocument class in a document-level project.

private void GetOMathObjects()
    foreach (Word.OMath mathObj in this.OMaths)
        mathObj.Justification = Word.WdOMathJc.wdOMathJcCenter;                
Return to top