Microsoft Support Number OR Call Toll-Free @ 1-844-478-2887

Wednesday, January 18, 2012

How to convert equations from Openoffice to MS-Word


1. First, convert your OO document to MSWord (in OO, don't forget to check that in the menu Tools/Options/Load Save/Microsoft Office, the Mathtype options are both checked)

2. Then open your document into MS-Word and apply one of the macros given below

3. Equations should be well converted and you can edit them with Mathtype or Equation Editor. However, if you changed the default equations fonts, greek letters may be not displayed correctly inside the Mathtype editor. But this is not a problem since they appear correctly in the document.

Please tell me if this solution worked for you!
Best regards,
Roland

Here are the macros.

If you have Mathtype, use the following macros :

Sub OOEquationConvertDocument()
'
' Convert all equations of the document
'
For Each iShape In ActiveDocument.InlineShapes
If iShape.Type = wdInlineShapeEmbeddedOLEObject Then
'MsgBox (iShape.OLEFormat.ClassType)
If iShape.OLEFormat.ClassType = "Microsoft" Then
iShape.OLEFormat.ConvertTo ClassType:="Equation.DSMT4", DisplayAsIcon:=False
End If
End If
Next iShape
End Sub
Sub OOEquationConvertSelection()
'
' Convert all equations of the current selection
' Caution! Doesn't work (why?) if the entire document is selected
'
For Each iShape In Selection.InlineShapes
If iShape.Type = wdInlineShapeEmbeddedOLEObject Then
'MsgBox (iShape.OLEFormat.ClassType)
If iShape.OLEFormat.ClassType = "Microsoft" Then
iShape.OLEFormat.ConvertTo ClassType:="Equation.DSMT4", DisplayAsIcon:=False
End If
End If
Next iShape
End Sub


If you don't have Mathtype (then you should have Equation Editor), use the following macros :

Sub OOEquationConvertDocument()
'
' Convert all equations of the document
'
For Each iShape In ActiveDocument.InlineShapes
If iShape.Type = wdInlineShapeEmbeddedOLEObject Then
'MsgBox (iShape.OLEFormat.ClassType)
If iShape.OLEFormat.ClassType = "Microsoft" Then
iShape.OLEFormat.ConvertTo ClassType:="Equation.3", DisplayAsIcon:=False
End If
End If
Next iShape
End Sub
Sub OOEquationConvertSelection()
'
' Convert all equations of the current selection
' Caution! Doesn't work (why?) if the entire document is selected
'
For Each iShape In Selection.InlineShapes
If iShape.Type = wdInlineShapeEmbeddedOLEObject Then
'MsgBox (iShape.OLEFormat.ClassType)
If iShape.OLEFormat.ClassType = "Microsoft" Then
iShape.OLEFormat.ConvertTo ClassType:="Equation.3", DisplayAsIcon:=False
End If
End If
Next iShape
End Sub
Post a Comment