Class OMathFunction (Word VBA)

The class OMathFunction represents a mathematical function or structure that Microsoft Word supports, such as fractions, integrals, sums, and radicals. The OMathFunction object is a member of the OMathFunctions collection.

The main procedure of class OMathFunction is OMathFunctions.Add

For Each

Here is an example of processing the OMathFunction items in a collection.

Dim omh As OMath: Set omh = 
Dim omfFunction As OMathFunction
For Each omfFunction In omh.Functions
	With omfFunction
	End With
Next omfFunction


This is the main method of the OMathFunction class

OMathFunctions.Add - Inserts a new structure, such as a fraction, into an equation at the specified position and returns an OMathFunction object that represents the structure.

Dim omfs As OMathFunctions: Set omfs =  
Dim omf As OMathFunction
Set omf = omfs.Add(Range:=, Type:=wdOMathFunctionAcc)


Acc returns an OMathAcc object that represents a base character with a combining accent mark.

Dim omaAcc As OMathAcc
Set omaAcc = omf.Acc

Args returns an OMathArgs object that represents the arguments for an equation.

Dim omasArgs As OMathArgs
Set omasArgs = omf.Args

Bar returns an OMathBar object that represents the mathematical overbar for an object.

Dim ombBar As OMathBar
Set ombBar = omf.Bar

BorderBox returns an OMathBorderBox object that represents a border drawn around an equation or part of an equation. The BorderBox object can also be used to draw horizontal, vertical, and diagonal strikethrough lines through the BorerBox arguments.

Dim ombBorderBox As OMathBorderBox
Set ombBorderBox = omf.BorderBox

Box returns an OMathBox object that represents an invisible box around an equation or part of an equation to which you can apply properties that affect the mathematical or formatting properties, such as line breaks.

Dim ombBox As OMathBox
Set ombBox = omf.Box

Delim returns an OMathDelim object that represents the delimiter function.

Dim omdDelim As OMathDelim
Set omdDelim = omf.Delim

EqArray returns an OMathEqArray object that represents an equation array function.

Dim arrEqArray As OMathEqArray
Set arrEqArray = omf.EqArray

Frac returns an OMathFrac object that represents a fraction.

Dim omfFrac As OMathFrac
Set omfFrac = omf.Frac

Func returns an OMathFunc object that represents a type of mathematical function that consists of a function name, such as sin or cos, and an argument.

Dim omfFunc As OMathFunc
Set omfFunc = omf.Func

GroupChar returns an OMathGroupChar object that represents a horizontal character placed above or below text in an equation, often with the purpose of grouping the text visually.

Dim omgGroupChar As OMathGroupChar
Set omgGroupChar = omf.GroupChar

LimLow returns an OMathLimLow object that represents the lower limit for a function.

Dim omlLimLow As OMathLimLow
Set omlLimLow = omf.LimLow

LimUpp returns an OMathLimUpp object that represents upper limit function.

Dim omlLimUpp As OMathLimUpp
Set omlLimUpp = omf.LimUpp

Mat returns an OMathMat object that represents a mathematical matrix.

Dim ommMat As OMathMat
Set ommMat = omf.Mat

Nary returns an OMathNary object that represents the n-ary operation.

Dim omnNary As OMathNary
Set omnNary = omf.Nary

OMath returns an OMath object that represents the equation.

Dim omhOMath As OMath
Set omhOMath = omf.OMath

Parent returns an object that represents the parent object of the specified OMathFunction object.

Dim objParent As Object
Set objParent = omf.Parent

Phantom returns an OMathPhantom object that represents an object used for advanced layout of an equation.

Dim ompPhantom As OMathPhantom
Set ompPhantom = omf.Phantom

Rad returns an OMathRad object that represents the mathematical radical function.

Dim omrRad As OMathRad
Set omrRad = omf.Rad

Range returns a Range object that represents the portion of a document that is contained in the specified object.

Dim rngRange As Range
Set rngRange = omf.Range

ScrPre returns an OMathScrPre object that represents a superscript and subscript to the left of the base.

Dim omsScrPre As OMathScrPre
Set omsScrPre = omf.ScrPre

ScrSub represents an OMathScrSub object that represents the mathematical subscript function.

Dim omsScrSub As OMathScrSub
Set omsScrSub = omf.ScrSub

ScrSubSup returns an OMathScrSubSup object that represents a mathematical subscript-superscript object that consists of a base, a subscript, and a superscript.

Dim omsScrSubSup As OMathScrSubSup
Set omsScrSubSup = omf.ScrSubSup

ScrSup returns an OMathScrSup object that represents the mathematical superscript function.

Dim omsScrSup As OMathScrSup
Set omsScrSup = omf.ScrSup

Type returns a WdOMathFunctionType constant that represents the type of function.

Dim womType As WdOMathFunctionType
womType = omf.Type

OMathFunctions.Count returns the number of items in the OMathFunctions collection.

Dim omfs As OMathFunctions: Set omfs =  
Dim lngCount As Long
lngCount = omfs.Count

OMathFunctions.Parent returns an object that represents the parent object of the specified OMathFunctions object.

Dim omfs As OMathFunctions: Set omfs =  
Dim objParent As Object
Set objParent = omfs.Parent