Moderator note:
This was marked as not helpful by JohnQPublic (the person who asked the question). I have restored it because it is referenced in the response marked as an Answer and may be helpful.
Use Word VBA to copy each native Office Math equation as a picture and paste it directly over the equation’s range; this preserves its location in paragraphs and table cells and normally preserves its rendered dimensions.
VBA macro
Make a backup first: the macro permanently replaces editable equations with pictures.
- Save a copy of the document as Word Macro-Enabled Document (
.docm).
- Press Alt+F11.
- Select Insert > Module.
- Paste and run this macro:
Sub ReplaceEquationsWithPictures()
Dim i As Long
Dim eqRange As Word.Range
Application.ScreenUpdating = False
On Error GoTo CleanUp
'Work backward so replacements do not disturb later ranges.
For i = ActiveDocument.OMaths.Count To 1 Step -1
Set eqRange = ActiveDocument.OMaths(i).Range.Duplicate
eqRange.CopyAsPicture
eqRange.PasteSpecial _
Link:=False, _
Placement:=wdInLine, _
DataType:=wdPasteMetafilePicture
Next i
CleanUp:
Application.ScreenUpdating = True
If Err.Number <> 0 Then
MsgBox "Stopped at equation " & i & ":" & vbCrLf & _
Err.Description, vbExclamation
Else
MsgBox "All Office Math equations were replaced.", vbInformation
End If
End Sub
Word exposes native equations through the document’s OMaths collection, with each OMath.Range identifying the equation’s exact text range.^1^ ^2^ The macro duplicates that range so its endpoints can be used safely during replacement.
CopyAsPicture copies the rendered range as a picture; Microsoft’s example pastes the result using wdPasteMetafilePicture.^3^ Because PasteSpecial is called on the original, non-collapsed equation range, the picture replaces that range rather than being inserted beside it. Placement:=wdInLine makes the result participate in text flow as a character.^4^ Inline pictures are positioned like characters, which is appropriate for equations embedded in paragraphs and table cells.^5^
Layout expectations and limitations
- Inline equations: remain at the same character position and retain surrounding paragraph flow.
- Equations in table cells: remain in the same cell; the table layout may recalculate if Word interprets the pasted picture’s metrics slightly differently.
- Standalone equations: remain in the same paragraph. Existing paragraph alignment, indentation, spacing, and table-cell alignment remain applicable.
- Image dimensions:
CopyAsPicture normally carries the equation’s rendered dimensions into the metafile. The macro deliberately does not set Width or Height, because an OMath object does not expose those picture-style dimensions directly.
- Editability: the results are pictures, not equations. Keep the original document if later equation editing may be required.
- Other document stories:
ActiveDocument.OMaths addresses the document equation collection. Equations in headers, footers, or text boxes may require separate processing through StoryRanges; Word represents those document areas as separate stories.^6^
If some equations are skipped
The macro targets native Office Math/OMML equations. Select a skipped equation:
- If Equation Tools appears, it should normally be an Office Math equation.
- If it is an older Microsoft Equation Editor object, convert it first by double-clicking it or selecting it and pressing Enter, then accept Word’s conversion prompt. That converter is available in Microsoft 365 and Office 2019 build 16.0.10730 or later, and the document may need to be saved as
.docx first.^7^
- Third-party equation objects, such as unconverted MathType/OLE objects, are not members of
OMaths and require tool-specific conversion or separate OLE-object handling.
Run the macro on a representative copy first and compare page count, table row heights, line wrapping, and equation baselines before processing the production files.
References
- Document.OMaths property (Word)
- OMath object (Word)
- Range.CopyAsPicture method (Word)
- Range.PasteSpecial method (Word)
- InlineShape object (Word)
- Document.StoryRanges property (Word)
- [Newer versions](#tab/newer-versions)