DocumentBase.OMaths 屬性

取得文件中 OMath 物件的集合。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

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

屬性值

型別:Microsoft.Office.Interop.Word.OMaths
OMaths 集合,包含文件中的 OMath 物件。

範例

下列程式碼範例會逐一查看文件中存在的所有 OMath 物件,並將每一個物件的對齊方式設定為置中對齊。 這段程式碼要求文件中必須至少已加入一個 OMath 物件,例如方程式。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間