Expand Minimize

DocumentBase.OMaths Property

Gets the collection of 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 OMath objects in the document.

The following code example iterates through all the 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 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;                
    }
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft