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

Methods

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)

Properties

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

7 
Dim omaAcc As OMathAcc
Set omaAcc = omf.Acc

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

7 
Dim omasArgs As OMathArgs
Set omasArgs = omf.Args

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

7 
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.

7 
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.

7 
Dim ombBox As OMathBox
Set ombBox = omf.Box

Delim returns an OMathDelim object that represents the delimiter function.

7 
Dim omdDelim As OMathDelim
Set omdDelim = omf.Delim

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

7 
Dim arrEqArray As OMathEqArray
Set arrEqArray = omf.EqArray

Frac returns an OMathFrac object that represents a fraction.

7 
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.

7 
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.

7 
Dim omgGroupChar As OMathGroupChar
Set omgGroupChar = omf.GroupChar

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

7 
Dim omlLimLow As OMathLimLow
Set omlLimLow = omf.LimLow

LimUpp returns an OMathLimUpp object that represents upper limit function.

7 
Dim omlLimUpp As OMathLimUpp
Set omlLimUpp = omf.LimUpp

Mat returns an OMathMat object that represents a mathematical matrix.

7 
Dim ommMat As OMathMat
Set ommMat = omf.Mat

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

7 
Dim omnNary As OMathNary
Set omnNary = omf.Nary

OMath returns an OMath object that represents the equation.

7 
Dim omhOMath As OMath
Set omhOMath = omf.OMath

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

7 
Dim objParent As Object
Set objParent = omf.Parent

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

7 
Dim ompPhantom As OMathPhantom
Set ompPhantom = omf.Phantom

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

7 
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.

7 
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.

7 
Dim omsScrPre As OMathScrPre
Set omsScrPre = omf.ScrPre

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

7 
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.

7 
Dim omsScrSubSup As OMathScrSubSup
Set omsScrSubSup = omf.ScrSubSup

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

7 
Dim omsScrSup As OMathScrSup
Set omsScrSup = omf.ScrSup

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

7 
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