Jump to content

Adding DOCX import to official OOo 2.4.3?


Recommended Posts

Posted (edited)

Some of you may know that unofficial OOos like OxygenOffice and Go-OO had an import filter for DOCX (and other Office 2007 files). I ran across this:

http://wiki.services.openoffice.org/wiki/WriterFilter

After reading that, I can't help thinking that by adding the appropriate files from OxygenOffice or ***perhaps*** (and it would be wonderful if this would work), OOo 3.x and modifying the appropriate xfu files (can be modified with notepad) in the ...Program Files\OpenOffice.org 2.4\share\registry\modules\org\openoffice\TypeDetection\Filter directory that maybe we could add import abilities to the official OOo 2.4.3.

Just in case anyone asks why we simple wouldn't use the last versions of OxygenOffice or Go-OO for Windows 98, I recall someone pointing out that these had problems that don't exist in the official OOo. I can't recall what they were, perhaps someone could chime in.

I note that there's a file called writerfilter680mi.dll (if I'm not mistaken it's called writerfiltermi.dll in OOo 3.x), in the OxygeOffice version 2.4.1 (last for Windows 98/ME). I ***believe*** that's the file of interest for DOCX import. I'm ***guessing*** by adding (or replacing) that file in the official 2.4.3 version and modifying fcfg_writer_filters.xcu, we should be able to add the ability to import DOCX files.

Maybe someone else can take a look at this an figure it out. I'm going to start messing with it, but I'm on XP.

Even version 3.x doesn't render DOCX files that well, so if you have another solution that works well I'd stick with it. Perhaps, in time, another solution can be made available.

Forgive me if this was a bit rambling, I was trying to be thorough.

Edited by Steven W

Posted

Well, this was a failure but, I did find some things that might interest anyone else in attempting to place the files from OxygenOffice 2.4.1 into OpenOffice 2.4.3:

It appears that, ***at minimum*** 1 file needs added (writerfilter680mi.dll) and 3 files need modified (fcfg_writer_filters.xcu, fcfg_writer_types.xcu and services.rdb)

The XCU files can easily be edited with Emacs for Windows.

Here's the code I added to fcfg_writer_filters.xcu, from the equivalent file in OxygenOffice:

<node oor:name="MS Word 2007" oor:op="replace">

<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER</value></prop>

<prop oor:name="UIComponent"/>

<prop oor:name="FilterService"><value>com.sun.star.comp.Writer.WriterFilter</value></prop>

<prop oor:name="UserData"><value>OXML</value></prop>

<prop oor:name="UIName"><value xml:lang="x-default">Microsoft Word 2007</value></prop>

<prop oor:name="FileFormatVersion"><value>0</value></prop>

<prop oor:name="Type"><value>writer_MS_Word_2007</value></prop>

<prop oor:name="TemplateName"/>

<prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>

</node>

Here's the code added to fcfg_writer_types.xcu, again for OxygenOffice's equivalent:

<node oor:name="writer_MS_Word_2007" oor:op="replace" >

<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.WriterFilterDetector</value></prop>

<prop oor:name="URLPattern"/>

<prop oor:name="Extensions"><value>docx</value></prop>

<prop oor:name="MediaType"><value>application/msword</value></prop>

<prop oor:name="Preferred"><value>true</value></prop>

<prop oor:name="PreferredFilter"><value>MS Word 2007</value></prop>

<prop oor:name="UIName">

<value>Microsoft Word 2007</value>

</prop>

<prop oor:name="ClipboardFormat"><value>MSWordDoc</value></prop>

</node>

Now I'm stuck with that "com.sun.star.comp.Writer.WriterFilterDetector" it seems to be a service that needs to be included in services.rdb. I'm not sure what that file is -- It can't be edited, maybe it's compiled. I did find this:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546723

which is obviously debian, but I saw this "code" on that page:

/ com.sun.star.comp.Writer.WriterFilterDetector

/ UNO

/ ACTIVATOR

Value: Type = RG_VALUETYPE_STRING

Size = 34

Data = "com.sun.star.loader.SharedLibrary"

/ SERVICES

/ com.sun.star.document.ExtendedTypeDetection

/ LOCATION

Value: Type = RG_VALUETYPE_STRING

Size = 63

Data = "vnd.sun.star.expand:$OOO_BASE_DIR/program/libwriterfilterli.so"

I looks to me as if all this does is look for the so file, I'm guessing on windows it'd look for the dll. Anyway, I give up for now.

Posted (edited)

Well I did it. Ended up all that was left was to get a hold of the OpenOffice.org SDK version 2.4.3 and use the regcomp.exe at the command prompt:

regcomp -register -r services.rdb -c writerfilter680mi

I had to copy regcomp.exe to the "...Program Files\OpenOffice.org 2.4\program" directory to use it

for those interested in doing this, I would not copy and paste my test above into the XCU files, I would do it from emacs for Windows (yes there's a version for 98, perhaps the latest; can't recall). If someone's really interested and would promise to back up their files, I'll zip my modified ones and upload somewhere. I will do this again from scratch to ensure my directions are correct and when I have the time, I'll test the files from OpenOffice.org 3.X. on my friends 98 box.

Edited by Steven W

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...