Udostępnij za pośrednictwem


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)

Syntax

'Declaration
Public ReadOnly Property OMaths As OMaths
    Get
public OMaths OMaths { get; }

Property Value

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

Examples

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 Sub GetOMathObjects()
    For Each mathObj As Word.OMath In Me.OMaths
        mathObj.Justification = Word.WdOMathJc.wdOMathJcCenter
    Next
End Sub
private void GetOMathObjects()
{            
    foreach (Word.OMath mathObj in this.OMaths)
    {
        mathObj.Justification = Word.WdOMathJc.wdOMathJcCenter;                
    }
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace