OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

TIP : How to convert equations from Openoffice to MS-Word

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Math
View previous topic :: View next topic  
Author Message
roland65
General User
General User


Joined: 13 Dec 2007
Posts: 22

PostPosted: Thu Dec 13, 2007 7:34 am    Post subject: TIP : How to convert equations from Openoffice to MS-Word Reply with quote

Hi,
you certainly noticed that when converting a document from Openoffice to MS-Word, equations are not well converted : there are a lot of blank squares everywhere.

Here follows a solution to this problem. It was successfully tested with Openoffice 2.3.1 on Linux and MS-Word 2000 on Windows, but you should try it with other versions.

The solution is :
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
Back to top
View user's profile Send private message
asknans
General User
General User


Joined: 29 Jan 2008
Posts: 15

PostPosted: Thu Feb 14, 2008 10:10 am    Post subject: Reply with quote

wow it works . thanks roland , I saved a lot of time with this tip
Back to top
View user's profile Send private message
bucaro
General User
General User


Joined: 23 Jul 2006
Posts: 5
Location: Bogota; Colombia

PostPosted: Fri May 09, 2008 1:38 pm    Post subject: Reply with quote

thx it works Very Happy
Back to top
View user's profile Send private message MSN Messenger
jtc611
Newbie
Newbie


Joined: 12 Jul 2009
Posts: 1

PostPosted: Sun Jul 12, 2009 11:05 am    Post subject: Open office / MS office formula compatibility Reply with quote

That macro is by far the best option I've found, and can confirm it works for creating documents in open office 3.0.1, saving them as .doc files, and reading them in Word 2007. For those of you struggling like I have with compatibility going from OOo to Word 2007 using formulas, I'd like to compile my observations here.

Options for formula editor in OOo 3.0.1
a) Open Office formula (built in)
b) OOlatex 4.0.0 (beta)

For both a) and b), I use the following to create right numbered equations
fn <space> F3

Option a)
Tricky to learn if you have been spoiled on Mathtype or know the LaTeX commands, but the command line language is intuitive and easy to learn and apply if you have the command reference handy. Upon saving as a word 2003 document (.doc), you run the macro listed in one of the messages above. I have confirmed this works for word 2007 installed in Jaunty Jackalope Ubuntu using Crossover, using Word's built in equation editor. Cross over supports some versions of Mathtype, but not mine unfortunately. Otherwise I would have stuck with Word and not Open Office, which I have grown to like better now.

Option b)
If you like latex or have familiarity with it, this OOlatex extension is great. Unfortunately, I have encountered a set back. If you click the 'emf' option, the equations look beautiful in OOo but when you save as a .doc file, in my case even the most simple equations lock word up. I think it has something to do with needing appropriate font installed in word based on what I've read. This is not an acceptable option if you must share your documents with others, demanding that they install your pesky font, or whatever other kludge someone figures out. The alternative is to save your equations with 'png' enabled in OOlatex. The equations convert well to word 2007 and don't lock it up, but for some reason they look grainy in OOo beyond legibility and equally bad when converted to pdf documents.

Conclusion: If you want to work in Linux and abandon MS software, but still need to create word documents readable by others, the best route I have found is to
1. Use OOo's built in formula editor
2. Save as a .doc file
3. Open in word
4. Run the macro which gets rid of the squares, and finally
5. Pop open a brew, because it is miller time.

I hope this is helpful to someone.
Back to top
View user's profile Send private message
gatorbrit
General User
General User


Joined: 28 Mar 2008
Posts: 22

PostPosted: Tue Aug 18, 2009 7:24 pm    Post subject: Reply with quote

Thanks - it was useful. I've basically been going around in circles for ever trying to figure the solution to the equation issue. This works well. It's also good to know that I am not the only one.

It would be great if a new version of OO would tackle this issue though.
Back to top
View user's profile Send private message
lehathanh
Newbie
Newbie


Joined: 25 Aug 2009
Posts: 1

PostPosted: Tue Aug 25, 2009 8:32 pm    Post subject: It works! Reply with quote

It is very useful...

I usually have to spend lot of time for retyping math equations from OO into MS Word. Now I feel much comfortable.

Test with Word 2003 and OO 3.0.1! Wonder the conversion function is embedded in new versions

Thank you very much!
_________________
hathanh_le
Back to top
View user's profile Send private message Yahoo Messenger
ohyeahq
General User
General User


Joined: 03 Aug 2005
Posts: 9

PostPosted: Sun Jan 03, 2010 5:58 pm    Post subject: Writer Macro Instead? Reply with quote

It works but also is rather useless for me, cause I don't have Word. (If I had, why bother writing equations in OpenOffice?)

Can you do the same thing using macros in OpenOffice?
Back to top
View user's profile Send private message
kbostroem
Newbie
Newbie


Joined: 25 Feb 2010
Posts: 2

PostPosted: Thu Feb 25, 2010 2:59 am    Post subject: Reply with quote

Hi,

could someone please give me more detailed instructions how to use these macros in the document? I have tried it by myself (never used macros before), but it all ends up with "Runtime error 16389".

Thanks and best regards,

Kim
Back to top
View user's profile Send private message
kbostroem
Newbie
Newbie


Joined: 25 Feb 2010
Posts: 2

PostPosted: Thu Feb 25, 2010 5:02 am    Post subject: Reply with quote

Hi again,
it seems the problem is related to NeoOffice, the Mac-optimized version of OpenOffice. It seems that NeoOffice simply does not convert the embedded formulas into Word Equations, although the corresponding MathType conversion checkbox in the preferences is checked. OpenOffice for Mac, in contrast, does the conversion. The formulas still look ugly when opening the converted file in Word, but then I can apply the Macro successfully.
Maybe this is of help to other people using formulas in NeoOffice.
Back to top
View user's profile Send private message
KyleS
Newbie
Newbie


Joined: 27 Mar 2010
Posts: 2

PostPosted: Sat Mar 27, 2010 12:20 pm    Post subject: Reply with quote

Here is how I do it, I just take a screen shot and save as a jpg. Then embed the jpg and that is that. I suppose it means I cannot edit them but I usually am pretty good at proof reading and it works no matter where I send it
Back to top
View user's profile Send private message AIM Address
rabilonick2
Newbie
Newbie


Joined: 01 Aug 2007
Posts: 3

PostPosted: Tue Apr 13, 2010 10:20 am    Post subject: Converting equations to Word Reply with quote

The equation editor macro works great. All you do in Word is go to the macro menu item and create the macro (paste it into the box) and then run it. Not sure why OOo can't just do the conversion when going to .doc or docx.

Usually I have no problem in OOo saving to .doc or .docx. But I created a new document (partly from pasting from older documents), and everytime I try to save as .doc or .docx, OOo crashes. I've broken the document up and was able to convert pieces. The one part that I ended up deleting that seemed to be causing the problem looked just like fairly plain text. I have no idea why it caused a problem. I tried deleting embedded graphics but that wasn't the problem. Also, there did not seem to be a problem with all the equations (and I was able to convert them in Word using the macro). (I'm now using OOo 3.1 in Ubuntu 9.10. Never ran into the problem before. Don't know if it has anything to do with going from 9.04 to 9.10.)

Thanks for the macros!
Back to top
View user's profile Send private message
shunra
Newbie
Newbie


Joined: 29 Nov 2011
Posts: 1

PostPosted: Wed Nov 30, 2011 10:11 am    Post subject: Is the a way to make the fix from OpenOffice itself? Reply with quote

Exclamation I don't have MS-office on my computer. I need to send the documents that I make to people that work with MS-office only. They don't know about OpenOffice.

Crying or Very sad I can not expect them to use the macros that you suggest here.

Crying or Very sad I can not use them either, as I don't have MS-word.

Question What can I do?
Back to top
View user's profile Send private message
hulala3232
Newbie
Newbie


Joined: 12 Apr 2012
Posts: 1

PostPosted: Thu Apr 12, 2012 3:16 am    Post subject: Reply with quote

Convert ur Open Office document to MSWord , don't forget to check that in the menu Tools/Options/Load Save/Microsoft Office, the Mathtype options are both checked)
Back to top
View user's profile Send private message
mathteacher177
Newbie
Newbie


Joined: 26 Nov 2012
Posts: 1

PostPosted: Mon Nov 26, 2012 1:44 pm    Post subject: help Reply with quote

Hello!

Would try to help.
I think you can do this using LATEX editor.
Step 1 you enter the formula
Step 2 you copy the image of formula everywhere you want!
You can try to do it using this one Latex editor:
http://www.numberempire.com/texequationeditor/equationeditor.php

It will work in the way I told you
Between steps 1 and to don't forget to push "render equation"

Hope it will help you!

All the best!
Back to top
View user's profile Send private message
hostzzoo20
Newbie
Newbie


Joined: 12 Jul 2013
Posts: 1

PostPosted: Fri Jul 19, 2013 2:30 am    Post subject: Re: TIP : How to convert equations from Openoffice to MS-Wor Reply with quote

roland65 wrote:
Hi,
you certainly noticed that when converting a document from Openoffice to MS-Word, equations are not well converted : there are a lot of blank squares everywhere.

Here follows a solution to this problem. It was successfully tested with Openoffice 2.3.1 on Linux and MS-Word 2000 on Windows, but you should try it with other versions.

The solution is :
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


Nice coding. Thanks a lot
_________________
sites like fiverr
fiverr
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Math All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group