Word VBA, Delete Equations

In order to delete an equation using VBA for word, you will have to know its index. Equations are referenced through the OMaths collection.

In the example the below the first equation in the document is removed along with all its text:

OMaths.Item(1).Range.Select
Selection.Delete

Before:

Equation Before Delete

After:

Equation After Delete

If you only want to remove the equation object, but still keep the equation text, you could use the Remove function of the OMaths object:

OMaths.Item(1).Remove

Result:

Delete Result, Remove

See also:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com

Leave a Reply

Your email address will not be published. Required fields are marked *