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
collection.OMaths
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:
After:
If you only want to remove the equation object, but still keep the equation text, you could use the
function of the Remove
object:OMaths
OMaths.Item(1).Remove
Result:
See also:
- Word VBA Creating Equations
- Word VBA, Changing the Font Format of Characters in an Equations
- Word VBA, Looping Through Equations
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