Class OMathRecognizedFunction (Word VBA)

The class OMathRecognizedFunction represents a recognized function. The OMathRecognizedFunction object is a member of the OMathRecognizedFunctions collection.


To use a OMathRecognizedFunction class variable it first needs to be instantiated, for example

Dim omr as OMathRecognizedFunction
Set omr = Application.OMathAutoCorrect.Functions(Index:=1)

The following procedures can be used to set variables of type OMathRecognizedFunction: OMathRecognizedFunctions.Add, OMathRecognizedFunctions.Item and OMathAutoCorrect.Functions

For Each

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

Dim omrFunction As OMathRecognizedFunction
For Each omrFunction In Application.OMathAutoCorrect.Functions
Next omrFunction


Deletes the specified recognized function from the list of the recognized functions.



Returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = Application.OMathAutoCorrect.Functions(1).Index


Returns a String that represents the name of an equation recognized function.

Dim strName As String
strName = Application.OMathAutoCorrect.Functions(1).Name


Returns an object that represents the parent object of the specified OMathRecognizedFunction object.

Dim objParent As Object
Set objParent = Application.OMathAutoCorrect.Functions(1).Parent


Creates a new recognized function and returns an OMathRecognizedFunction object.

Syntax : expression.Add (Name)

Name: The name of the recognized function.

Dim strName As String: strName =  
Dim omr As OMathRecognizedFunction
Set omr = Application.OMathAutoCorrect.Functions.Add(Name:=strName)


Returns the number of items in the OMathRecognizedFunctions collection.

Dim lngCount As Long
lngCount = Application.OMathAutoCorrect.Functions.Count


Returns an OMathRecognizedFunction object that represents the specified item in the collection.

Syntax : expression.Item (Index)

Index: Specifies a String or Integer that represents the name or ordinal position of the object in the collection.

Dim omr As OMathRecognizedFunction
Set omr = Application.OMathAutoCorrect.Functions(Index:=1)


Returns an object that represents the parent object of the specified OMathRecognizedFunctions object.

Dim objParent As Object
Set objParent = Application.OMathAutoCorrect.Functions.Parent